Npm Factory

@npm-factory/init

CLI that generates a complete TypeScript monorepo with ESM packages, Fumadocs site, build scripts, and Changesets — from a single command.

  • Stability: beta
  • Platform: Node.js

Usage

npx @npm-factory/init

Or non-interactively:

npx @npm-factory/init \
  --project my-lib \
  --scope @my-org \
  --modules core,react \
  --playground single

CLI flags

FlagDescription
--project <id>Project id in kebab-case
--scope <scope>npm scope (e.g. @my-org)
--modules <ids>Comma-separated module ids (e.g. core,react)
--playground <mode>none, single, or per-module

All flags are required for non-interactive mode. Without them, the interactive wizard starts.

Re-running

Safe to run multiple times in the same directory. Existing files are skipped. Root package.json, turbo.json, tsconfig.base.json, and .changeset/config.json are patched (merged, not overwritten).

npm-factory-scripts

@npm-factory/init ships a npm-factory-scripts binary that provides check subcommands. These scripts discover your DOT config at runtime by scanning for packages/*-config/ in the workspace — no generated script files needed.

Subcommands

CommandDescription
npm-factory-scripts validateValidate DOT config
npm-factory-scripts docs-syncCreate missing doc skeleton files
npm-factory-scripts docs-orphansDetect orphan doc directories
npm-factory-scripts pack-smokePack + install + import test for each module
npm-factory-scripts changeset-requiredCheck that changesets exist for package changes
npm-factory-scripts checkRun all checks in sequence (validate, docs-sync, docs-orphans, build+publint+attw, pack-smoke, changeset-required)

The root pnpm check script runs npm-factory-scripts check.

On this page