npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

novel-epub

v2.0.16

Published

製作 node-novel 風格的 ePub 電子書 / create epub from node-novel style

Downloads

86

Readme

novel-epub

製作 node-novel 風格的 ePub 電子書 / create epub from node-novel style 合併小說 txt => epub

usage

changelog

從 1.1.35 開始支援 在打包時同時進行簡繁轉換 以及 部分格式語法

npx novel-epub --iconv cn
# 轉簡
npx novel-epub --iconv tw
# 轉繁

從 1.1.29 開始支援 附件表 ATTACH.md

只要小說內文出現以下格式(無視簡繁日漢字與全形半形)

  • (圖片xxx)
  • (插圖xxx)
  • (插畫xxx)
  • (畫像xxx)
  • (圖像xxx)

並且 ATTACH.md 內具有對應的 xxx 則會將該圖片於打包時插入內文中 如果路徑為網址,只有在設定了 downloadRemoteFile 時,才會將網路圖片下載為檔案並且置入 epub,否則只會保持原有的網路圖片形式

npx novel-epub --downloadRemoteFile

xxx 為隨意英文數字組合(純英文與數字),可自由設定,也不需要按照順序

ATTACH.md

# attach

## images

- 000: https://xs.dmzj.com/img/1406/79/a7e62ec50db1db823c61a2127aec9827.jpg
- 001: https://xs.dmzj.com/img/356/18/aad3384eb1d3755bfe958a2e276fc3c3.jpg
- 002: https://xs.dmzj.com/img/1256/36/966fddd3f964226937ef25bf7d921d7b.jpg
- 003: https://xs.dmzj.com/img/1151/48/83b213cf951287f3500a258aa6dcbd45.jpg
- 004: https://xs.dmzj.com/img/34/80/5ca3e65c2777c2761c11aa54e9680209.jpg

方案 1

小說資料夾所在位置輸入以下指令

npx novel-epub

方案 2

  1. npm install -g novel-epub 將此命令安裝為 Global 命令
  2. novel-epub -i PathOfTxt -o PathOfOutput 然後就可以執行以下指令

注意事項

  • 此模組要求資料夾底下必須要有 README.md 或者 meta.md 的存在 格式為 node-novel-info

最低條件至少要有以下內容

# novel

- title: 自卫队三部曲
  • 每一個子資料夾代表一個章/卷
  • 會自動對名稱排序 即使是 全形/半形 + 中文數字 混用的情況依然可以排序

epub 範例

cli

novel-epub --help

Options:
  --help                Show help                                      [boolean]
  --input, -i           小說資料夾路徑 source novel txt folder path     [string]
  --output, -o          epub 輸出路徑 output path  [string] [default: (default)]
  --tpl, -t             epub 模板 epub tpl                              [string]
  --filename, -f        epub 檔名 filename                              [string]
  --useTitle                                                     [default: true]
  --filenameLocal       try auto choose filename                 [default: true]
  --date, -d            epub 檔名後面追加日期 add current date end of filename
                                                                       [boolean]
  --lang, -l            epub 語言 epub lang                             [string]
  --vertical            是否輸出直排模式                               [boolean]
  --downloadRemoteFile  是否將網路資源下載到 epub 內                   [boolean]
  --iconv               是否在打包時同時進行 cn 轉為簡體, tw 轉為繁體   [string]
  --version             Show version number                            [boolean]

demo

import novelEpub from 'node-novel-epub';
import * as path from 'path';

let novelID: string;

novelID = '黑之魔王';
let TXT_PATH = path.join(__dirname, 'res', novelID);

novelEpub({
	inputPath: TXT_PATH,
	outputPath: './temp',
});

link