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 🙏

© 2026 – Pkg Stats / Ryan Hefner

novelsquare-downloader

v1.0.0

Published

Download novels from novelsquare.blog as Markdown files

Downloads

7

Readme

NovelSquare Downloader

命令行工具,用于从 novelsquare.blog 下载小说并导出为 Markdown 格式。

功能特点

  • 🔐 支持邮箱和 Google 登录
  • 📚 批量下载小说章节
  • 📝 导出为 Markdown 格式
  • ⚡ 自动限速(1-2秒/章节)
  • 🎯 支持指定章节范围
  • 💾 Cookie 持久化,登录一次永久使用

安装

方式一:从 npm 安装(推荐)

# 全局安装
npm install -g novelsquare-downloader

# 或使用 npx 运行(无需安装)
npx novelsquare-downloader download <slug>

方式二:从源码安装

# 克隆仓库
git clone https://github.com/bluetent/novelsquare-downloader.git
cd novelsquare-downloader

# 安装依赖
npm install

# 构建
npm run build

# 全局安装(可选)
npm link

使用方法

1. 首次登录

# 如果全局安装了
novelsquare login

# 或者直接运行
npm run dev -- login

这会打开一个浏览器窗口,你可以在其中手动登录(支持邮箱或 Google 登录)。登录完成后按回车,程序会自动保存登录信息。

2. 下载小说

# 基本用法
novelsquare download alphas-regret-the-luna-is-secret-heiress

# 指定输出路径
novelsquare download <slug> -o ./my-novels/

# 下载指定章节范围
novelsquare download <slug> --start 10 --end 50

# 匿名下载(不登录)
novelsquare download <slug> --no-login

3. 检查登录状态

novelsquare status

参数说明

download 命令

  • <slug> - 小说的 URL slug(必需)

    • 例如:alphas-regret-the-luna-is-secret-heiress
    • 从小说 URL 中获取:https://novelsquare.blog/novel/alphas-regret-the-luna-is-secret-heiress
  • -o, --output <path> - 输出路径(可选)

    • 可以是文件路径:-o my-novel.md
    • 也可以是目录:-o ./novels/
  • --start <number> - 起始章节号(默认:1)

  • --end <number> - 结束章节号(默认:全部)

  • --no-login - 匿名下载(不使用登录信息)

输出格式

下载的小说会保存为单个 Markdown 文件,包含:

  • 小说标题和作者
  • 完整目录(可点击跳转)
  • 所有章节内容

示例:

# Alpha's Regret: The Luna Is Secret Heiress

**作者**: FindNovel.net
**章节数**: 50

---

## 目录
1. [Chapter 1](#chapter-1)
2. [Chapter 2](#chapter-2)
...

---

## Chapter 1
{章节内容}

---

配置

登录信息保存在:~/.novelsquare-cookies.json

可以在 src/utils/config.ts 中调整:

  • 下载延迟时间
  • Cookie 保存路径

开发

# 安装依赖
npm install

# 开发模式运行
npm run dev -- <command>

# 构建
npm run build

# 运行已构建的版本
node dist/cli.js <command>

故障排除

登录失败

  • 确保在浏览器窗口中完全登录后再按回车
  • 检查 ~/.novelsquare-cookies.json 是否存在

下载内容为空

  • 确认小说 slug 正确
  • 尝试手动访问章节 URL 确认是否需要登录
  • 网站结构可能已更改,需要更新 CSS 选择器

章节 404

  • 某些小说可能章节不连续,程序会自动跳过不存在的章节

技术栈

  • Node.js + TypeScript
  • Puppeteer(浏览器自动化)
  • Commander.js(CLI 框架)

License

MIT

免责声明

本工具仅供个人学习和研究使用。请遵守 novelsquare.blog 的服务条款。