Angular 9 References/ CLI

Library generator

This is the documentation for Angular 9.
You can switch to the latest version Angular 10.
ng generate library [name] [--[argument]=[value]]
ng generate lib

Generate a library project for Angular.

Links & Tutorials



The path to create the library's public API file.
Type string
Default public_api


When true, applies lint fixes after generating the library.
Type boolean
Default false


The prefix to apply to generated selectors.
Type string
Default lib
Aliases p


Skip installing dependency packages.
Type boolean
Default false


Do not add dependencies to `package.json`.
Type boolean
Default false


When true, does not update `tsconfig.json` to add a path mapping for the new library. The path mapping is needed to use the library in an app, but can be disabled here to simplify development.
Type boolean
Default false