Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to share angular library without NPM

I'm developing a component library which I don't want to share in npmjs, is there any way to share my angular library with other angular projects with out sharing it with NPM.

like image 351
Jayampathy Wijesena Avatar asked Jun 11 '19 09:06

Jayampathy Wijesena


People also ask

Can Angular use npm?

The Angular Framework, Angular CLI, and components used by Angular applications are packaged as npm packages and distributed using the npm registry. You can download and install these npm packages by using the npm CLI client, which is installed with and runs as a Node. js® application.

Can you use node packages in Angular?

Angular CLI is based on Node. JS and can be setup via npm, the Node package manager. As a front-end Angular developer, this is your first encounter with Node.


2 Answers

yes try verdaccio which stores ur packaged library in your local storage when u npm i libraryname first it searches for library in local storage and then searches for public npm https://verdaccio.org/docs/en/installation

like image 173
madhavsai bhushan Avatar answered Oct 20 '22 00:10

madhavsai bhushan


The best way - to have your own npm registry and publish in it. It's often in medium or big companies.

Easier way - to publish your package library in git repository and add lobrary as package with git source. You can see how to do it in npm documentation. https://docs.npmjs.com/files/package.json#dependencies

like image 1
vadjs Avatar answered Oct 20 '22 00:10

vadjs