Skip to content

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-eslint

Supported customizations

OptionCLI flagsType / valuesDefaultNotes
TypeScript--typescript
--no-typescript
booleantrueChoose a TypeScript or JavaScript package scaffold.
Build tool--build-tool <buildTool>tsup tsup
rollup rollup
esbuild esbuild
none none
tsupSelect the package build pipeline when TypeScript is enabled.
ESLint--eslint
--no-eslint
booleantrueAdds ESLint configuration.
Prettier--prettier
--no-prettier
booleanfalseAdds Prettier configuration.
Test framework--test-framework <testFramework>none none
vitest vitest
jest jest
noneSelect the generated test setup.

--yes defaults

Keyvalue
typescripttrue
buildTooltsup
eslinttrue
prettierfalse
testFrameworknone

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 publish flow when applicable.

Shared flow reminder

  • Shared flags such as --name, --directory, --package-manager, --git, and --debug apply 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.

Released under the MIT License.