Skip to content

Latest commit

 

History

History
110 lines (94 loc) · 4.54 KB

readlightnovels.md

File metadata and controls

110 lines (94 loc) · 4.54 KB

ReadLightNovels

const readlightnovels = new LIGHT_NOVELS.ReadLightNovels();

Methods

search

Note: This method is a subclass of the BaseParser 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)
readlightnovels.search("Classrrom of the Elite").then(data => {
  console.log(data);
})

returns a promise which resolves into an array of light novels. ( Promise<ISearch<ILightNovelResult>>)
output:

{
  results: [
    {
      id: 'youkoso-jitsuryoku-shijou-shugi-no-kyoushitsu-e', // the light novel id
      title: 'Youkoso Jitsuryoku Shijou Shugi no Kyoushitsu e Novel (Classroom of the Elite Novel)',
      url: 'https://readlightnovels.net/youkoso-jitsuryoku-shijou-shugi-no-kyoushitsu-e.html',
      image: 'https://readlightnovels.net/wp-content/uploads/2020/01/youkoso-jitsuryoku-shijou-shugi-no-kyoushitsu-e.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)
readlightnovels.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<ILightNovelInfo>)
output:

{
  id: 'youkoso-jitsuryoku-shijou-shugi-no-kyoushitsu-e',
  title: 'Youkoso Jitsuryoku Shijou Shugi no Kyoushitsu e Novel (Classroom of the Elite Novel)',
  url: 'https://readlightnovels.net/youkoso-jitsuryoku-shijou-shugi-no-kyoushitsu-e.html',
  image: 'https://readlightnovels.net/wp-content/uploads/2020/01/youkoso-jitsuryoku-shijou-shugi-no-kyoushitsu-e.jpg',
  author: 'Kinugasa Shougo衣笠彰梧',
  genres: [
    'Drama',
    'Harem',
    '...'
  ],
  rating: 8.6,
  views: 651729,
  description: 'Kōdo Ikusei Senior High School, a leading prestigious school with state-of-the-art facilities where nearly...',
  status: 'Ongoing',
  pages: 13,
  chapters: [
    {
      id: 'youkoso-jitsuryoku-shijou-shugi-no-kyoushitsu-e/volume-1-prologue-the-structure-of-japanese-society',
      title: 'Volume 1, Prologue: The structure of Japanese society',
      url: 'https://readlightnovels.net/youkoso-jitsuryoku-shijou-shugi-no-kyoushitsu-e/volume-1-prologue-the-structure-of-japanese-society.html'
    },
    {...}
    ...

fetchChapterContent

Parameters

Parameter Type Description
chapterId string chapter id. (chapter id can be found in the light novel info object)
readlightnovels.fetchChapterContent("youkoso-jitsuryoku-shijou-shugi-no-kyoushitsu-e/volume-1-prologue-the-structure-of-japanese-society").then(data => {
  console.log(data);
})

returns a content object. (Promise<ILightNovelChapterContent>)
output:

{
  text: '\n' +
    'It’s a bit sudden,...',
  html: '<p></p><p>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)