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

douban-box

v1.1.2

Published

![Update Gist](https://github.com/CodeDaraW/douban-box/workflows/Update%20Gist/badge.svg)

Readme

douban-box

Update Gist

安装

$ npm i -g douban-box

基本原理

提供四个环境变量: | 变量 | 含义 | |---|---| | GIST_ID | Gist ID | | GITHUB_TOKEN | GitHub Token | | DOUBAN_ID | 豆瓣用户 ID | | DOUBAN_COOKIE | 豆瓣登录态 Cookie |

执行 CLI 时会读取环境变量,抓取指定用户的主页,更新对应的 Gist,若无报错则说明更新成功。

$ douban-box

另外可以通过 GitHub Actions 免费实现定时更新的功能。

使用

1. 创建 Gist

Gist 中新建名为 douban.md 的文件,并从 URL 中得到 Gist ID。

2. 创建 GitHub Token

访问 Personal Access Tokens 创建更新 Gist 专用的 Token,需要勾选 gist Create gists 权限,记住生成的 Token。

3. 获取豆瓣 ID 和 Cookie

豆瓣 ID 是个人主页中 people 后紧接的那串数字或者自定义字符,例如我的主页链接 https://www.douban.com/people/daraw/ 中是 daraw,在登录态下查看 Cookie,其中 dbcl2 是关键,复制这个 key 对应的值,构造出 dbcl2="xxxxxxx" 即可当做 Cookie,当然把整个 Cookie 都复制过去也是可以的。

4. 通过 GitHub Actions 自动更新 Gist

创建一个 Repo,并启用 GitHub Actions,可以参考本项目的 .github/workflows/main.yml 文件,修改 GIST_IDDOUBAN_ID 为刚刚所得到的 Gist ID 和豆瓣 ID;为了不暴露自己的 GitHub Token 和豆瓣 Cookie,在项目的 Settings -> Secrets 中创建两个变量 TOKENDOUBAN_COOKIE,分别为 GitHub Token 和豆瓣 Cookie。

License

MIT License