0.5.2 • Published 4 years ago

@range3/narou v0.5.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

@range3/narou

npm version

小説家になろうNode.jsライブラリ

Install

$ yarn add @range3/narou

Usage

const Narou = require('@range3/narou')

const narou = new Narou()
const novel = narou.novel('ncode')
await novel.fetch()

// 小説メタデータ(なろう小説API出力を参照)
// https://dev.syosetu.com/man/api/#link6
const novel.metadata 

// 目次
const toc = novel.toc.toArray()
// [
//     { type: 'chapter', title: 'チャプター1タイトル' },
//     {
//       type: 'episode',
//       path: '/ncodeXXXXXX/1/',
//       no: 1,
//       subtitle: '1話サブタイトル',
//       created: '2018/07/27 11:26',
//       updated: '2018/10/20 14:04'
//     },
//     {
//       type: 'episode',
//       path: '/ncodeXXXXX/2/',
//       no: 2,
//       subtitle: '2話サブタイトル',
//       created: '2018/07/27 19:02',
//       updated: '2018/09/29 06:14'
//     },
//     { type: 'chapter', title: 'チャプター2タイトル' },
//     ...
// ]

console.log(novel.episodeLength)
const episode = novel.episode(10)
await episode.fetch()
console.log(episode.subtitle)
console.log(episode.preface)
console.log(episode.content)
console.log(episode.afterword)

// Bulk-get
const novels = await narou.getNovels(['n5519gi', 'nxxxxx'])

TODO

  • 短編小説対応
0.5.2

4 years ago

0.5.0

5 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago