diff --git a/docs/guides/light-novels.md b/docs/guides/light-novels.md index b751ad9c6..9ad218f64 100644 --- a/docs/guides/light-novels.md +++ b/docs/guides/light-novels.md @@ -16,6 +16,7 @@ const lightnovelProvider = LIGHT_NOVELS.(); ## Light Novels Providers List This list is in alphabetical order. (except the sub bullet points) +- [NovelUpdates](../providers/novelupdates.md) - [ReadLightNovels](../providers/readlightnovels.md) diff --git a/docs/providers/novelupdates.md b/docs/providers/novelupdates.md new file mode 100644 index 000000000..9c76ae20b --- /dev/null +++ b/docs/providers/novelupdates.md @@ -0,0 +1,109 @@ +

NovelUpdates

+ +```ts +const novelupdates = new LIGHT_NOVELS.NovelUpdates(); +``` + +

Methods

+ +- [search](#search) +- [fetchLightNovelInfo](#fetchlightnovelinfo) +- [fetchChapterContent](#fetchchaptercontent) + +### search +> Note: This method is a subclass of the [`BaseParser`](https://github.com/consumet/extensions/blob/master/src/models/base-parser.ts) class. meaning it is available across most categories. + +

Parameters

+ +| Parameter | Type | Description | +| --------- | -------- | ----------------------------------------------------------------------------------- | +| query | `string` | query to search for. (*In this case, We're searching for `Classrrom of the Elite`*) | + +```ts +novelupdates.search("Clasroom of the Elite").then(data => { + console.log(data); +}) +``` +returns a promise which resolves into an array of light novels. (* Promise>*)\ +output: +```js +{ + results: [ + { + id: 'youkoso-jitsuryoku-shijou-shugi-no-kyoushitsu-e', // the light novel id + title: 'Youkoso Jitsuryoku Shijou Shugi no Kyoushitsu e', + url: 'https://www-novelupdates-com.translate.goog/series/youkoso-jitsuryoku-shijou-shugi-no-kyoushitsu-e/?_x_tr_sl=ja&_x_tr_tl=en&_x_tr_hl=en-US', + image: 'https://cdn.novelupdates.com/imgmid/series_10266.jpg' + }, + {...} + ... + ] +} +``` + +### fetchLightNovelInfo + +

Parameters

+ +| Parameter | Type | Description | +| ---------------------- | -------- | ------------------------------------------------------------------------------------------------------ | +| lightNovelUrl | `string` | id or url of the light novel. (*light novel id or url can be found in the light novel search results*) | +| chapterPage (optional) | `number` | chapter page number (*default: -1 meaning will fetch all chapters*) | + +```ts +novelupdates.fetchLightNovelInfo("youkoso-jitsuryoku-shijou-shugi-no-kyoushitsu-e").then(data => { + console.log(data); +}) +``` +returns a promise which resolves into an light novel info object (including the chapters or volumes). (*Promise\*)\ +output: +```js +{ + id: 'youkoso-jitsuryoku-shijou-shugi-no-kyoushitsu-e', + title: 'Youkoso Jitsuryoku Shijou Shugi no Kyoushitsu e', + url: 'https://www.novelupdates.com/series/youkoso-jitsuryoku-shijou-shugi-no-kyoushitsu-e', + image: 'https://cdn.novelupdates.com/images/2017/02/cover00219.jpeg', + author: 'Kinugasa Shougo衣笠彰梧', + genres: [ + 'Drama', + 'Psychological', + '...' + ], + rating: 9, + views: NaN, + description: 'Kōdo Ikusei Senior High School, a leading prestigious school with state-of-the-art facilities where nearly...', + status: 'Completed', + chapters: [ + { + id: '6659442', + title: 'v17...', + url: 'https://www.novelupdates.com/extnu/6659442' + }, + {...} + ... +``` + +### fetchChapterContent + +

Parameters

+ +| Parameter | Type | Description | +| --------- | -------- | ---------------------------------------------------------------------- | +| chapterId | `string` | chapter id. (*chapter id can be found in the light novel info object*) | + +```ts +readlightnovels.fetchChapterContent("5692421").then(data => { + console.log(data); +}) +``` +returns a content object. (*Promise\*)\ +output: +```js +{ + text: '\n' + + 'It’s a bit sudden,...', + html: '

It’s a bit sudden, but listen seriously to the question I’m about to ask and think about...' +} +``` + +

(back to light novels providers list)

diff --git a/docs/providers/readlightnovels.md b/docs/providers/readlightnovels.md index 80105ab16..2e2d0ce5f 100644 --- a/docs/providers/readlightnovels.md +++ b/docs/providers/readlightnovels.md @@ -1,4 +1,4 @@ -

MangaDex

+

ReadLightNovels

```ts const readlightnovels = new LIGHT_NOVELS.ReadLightNovels();