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

create-notion-auto-lock-worker

v1.0.0

Published

Create a Notion Worker that automatically locks stale Notion pages.

Readme

Notion Auto Lock Worker

English | 日本語

Create an unofficial Notion Worker that automatically locks stale Notion pages.

The generated Worker scans configured root pages and data sources on a schedule, then locks pages that are still unlocked after the configured waiting period.

Notion Workers is currently in beta. APIs, CLI commands, pricing, templates, and hosting behavior may change.

This project is not made by, endorsed by, or affiliated with Notion.

Quick Start

npm create notion-auto-lock-worker@latest my-auto-lock-worker
cd my-auto-lock-worker
npm install
npm run check
ntn login

Create a Notion connection or personal access token with Read content and Update content. If you use an internal connection, share the target root pages or databases with that connection.

Set Worker secrets and deploy:

ntn workers env set AUTO_LOCK_API_TOKEN=ntn_...
ntn workers env set AUTO_LOCK_ROOT_PAGE_IDS=...
ntn workers env set DRY_RUN=true
ntn workers deploy

Keep DRY_RUN=true until the audit log looks correct. The generated project includes its own README with detailed setup, dry-run, deploy, and troubleshooting steps.

Configuration

| Name | Required | Default | Description | | --- | --- | --- | --- | | AUTO_LOCK_API_TOKEN | yes | none | Notion API token | | AUTO_LOCK_ROOT_PAGE_IDS | conditional | none | Comma-separated root page IDs to crawl recursively | | AUTO_LOCK_DATA_SOURCE_IDS | conditional | none | Comma-separated data source IDs to query directly | | WORKER_SCHEDULE | no | 1h | Scheduled sync interval, from 5m to 7d | | LOCK_AFTER_MINUTES | no | 180 | Minutes after last edit before locking | | DRY_RUN | no | true | Count eligible pages without locking them | | LOCK_ROOT_PAGES | no | false | Lock configured root pages themselves | | MAX_CRAWL_DEPTH | no | 10 | Maximum nested crawl depth | | MAX_CRAWL_PAGES | no | 1000 | Maximum pages to crawl in one run |

Set at least one of AUTO_LOCK_ROOT_PAGE_IDS or AUTO_LOCK_DATA_SOURCE_IDS.

Behavior

  • Runs as a scheduled worker.sync().
  • Crawls root pages, child pages, child databases, and data sources.
  • Locks pages with is_locked: true only after rechecking that they are still old enough and unlocked.
  • Treats configured root pages as crawl anchors unless LOCK_ROOT_PAGES=true.
  • Writes one summary row per run to a managed Auto Lock Runs audit database.

Schedule And Cost

The default schedule is 1h, and the default lock delay is 180 minutes. You can change the generated Worker schedule with --schedule during scaffolding or by setting WORKER_SCHEDULE before redeploying. Notion supports interval schedules from 5m to 7d.

As of 2026-06-23, Notion's Workers pricing guide says scheduled sync executions count as Worker runs, Workers typically cost about $0.0023 per run, and actual usage may vary.

| Schedule | Runs / month | Approx cost / month | | --- | ---: | ---: | | 1d | 30 | $0.07 | | 1h | 720 | $1.66 | | 15m | 2,880 | $6.62 | | 5m | 8,640 | $19.87 |

Customize the generated Worker:

npm create notion-auto-lock-worker@latest my-worker --schedule 15m
npm create notion-auto-lock-worker@latest my-worker --lock-after-minutes 120

Security

  • Do not commit Notion tokens.
  • Generated projects keep .env ignored. Store production values in Worker secrets.
  • Logs and audit rows avoid page titles, page content, property values, emails, full page URLs, and tokens.
  • Prefer an internal connection token for narrower access.
  • Report vulnerabilities privately using SECURITY.md.

References

License

MIT