-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better doc for Lists class + Full API retrieval
- Loading branch information
Showing
4 changed files
with
85 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
const anilist = require('../index'); | ||
const AniList = new anilist(); | ||
|
||
AniList.lists.anime('salixor') | ||
.then(data => { console.log(data.filter(l => l.status === 'CURRENT')); }); | ||
AniList.lists.manga('salixor') | ||
.then(data => { console.log(data.filter(l => l.status === 'CURRENT')); }); | ||
let animeLists = AniList.lists.anime('salixor'); | ||
let mangaLists = AniList.lists.manga('salixor'); | ||
|
||
// Read an anime list with specified status (here, COMPLETED) | ||
animeLists.then(lists => console.log(lists.filter(list => list.status === 'COMPLETED'))); | ||
|
||
// Read a manga list with specified status (here, CURRENT) | ||
mangaLists.then(lists => console.log(lists.filter(list => list.status === 'CURRENT'))); | ||
|
||
// Display a sample user list entry | ||
animeLists.then(lists => console.log(lists.filter(list => list.status === 'COMPLETED')[0].entries.filter(e => e.media.id === 20912))); |