NPM Package
NPM package ready for publishing (JavaScript or TypeScript)
Primary commands
bash
npx scafix create npm
npx scafix create npm --build-tool rollup --test-framework vitest --package-manager pnpm
npx scafix create npm --no-typescript --test-framework jest --no-eslintSupported customizations
| Option | CLI flags | Type / values | Default | Notes |
|---|---|---|---|---|
| TypeScript | --typescript--no-typescript | boolean | true | Choose a TypeScript or JavaScript package scaffold. |
| Build tool | --build-tool <buildTool> | tsup tsuprollup rollupesbuild esbuildnone none | tsup | Select the package build pipeline when TypeScript is enabled. |
| ESLint | --eslint--no-eslint | boolean | true | Adds ESLint configuration. |
| Prettier | --prettier--no-prettier | boolean | false | Adds Prettier configuration. |
| Test framework | --test-framework <testFramework> | none nonevitest vitestjest jest | none | Select the generated test setup. |
--yes defaults
| Key | value |
|---|---|
| typescript | true |
| buildTool | tsup |
| eslint | true |
| prettier | false |
| testFramework | none |
Notes
- The npm package scaffold requires an npm-safe package name.
- The generated README and next-step commands are tailored to the selected package manager.
- Publish guidance is package-manager aware, including Yarn Berry's
yarn npm publishflow when applicable.
Shared flow reminder
- Shared flags such as
--name,--directory,--package-manager,--git, and--debugapply here as well. - If required values are omitted and a TTY is available, Scafix prompts for them before calling the stack adapter.
- See CLI Reference for the shared command surface used by
scafix.
