From aef489f139f5c8ad44de791028643b4f442c0546 Mon Sep 17 00:00:00 2001 From: Aristeidis Bampakos Date: Wed, 26 May 2021 01:35:38 +0300 Subject: [PATCH] docs: add note for naming libraries (#42335) PR Close #42335 --- aio/content/guide/creating-libraries.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/aio/content/guide/creating-libraries.md b/aio/content/guide/creating-libraries.md index 3b3c157d65..9c8696ba7b 100644 --- a/aio/content/guide/creating-libraries.md +++ b/aio/content/guide/creating-libraries.md @@ -15,6 +15,16 @@ Use the Angular CLI to generate a new library skeleton in a new workspace with t ng generate library my-lib +
+ +
Naming your library
+ + You should be very careful when choosing the name of your library if you want to publish it later in a public package registry such as npm. See [Publishing your library](guide/creating-libraries#publishing-your-library). + + Avoid using a name that is prefixed with `ng-`, such as `ng-library`. The `ng-` prefix is a reserved keyword used from the Angular framework and its libraries. The `ngx-` prefix is preferred as a convention used to denote that the library is suitable for use with Angular. It is also an excellent indication to consumers of the registry to differentiate between libraries of different JavaScript frameworks. + +
+ The `ng generate` command creates the `projects/my-lib` folder in your workspace, which contains a component and a service inside an NgModule.