@nx/workspace:npm-package

Add a minimal npm package.

Usage

nx generate npm-package ...

By default, Nx will search for npm-package in the default collection provisioned in workspace.json.

You can specify the collection explicitly as follows:

nx g @nx/workspace:npm-package ...
Nx 15 and lower use @nrwl/ instead of @nx/

Show what will be generated without writing to disk:

nx g npm-package ... --dry-run

Options

name

Required
string
Pattern: (?:^@[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*\\/[a-zA-Z0-9-~][a-zA-Z0-9-._~]*|^[a-zA-Z][^:]*)$

Package name.

directory

dir
string

A directory where the package is placed.

projectNameAndRootFormat

string
Accepted values: as-provided, derived

Whether to generate the project name and root directory as provided (as-provided) or generate them composing their values and taking the configured layout into account (derived).