Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bower init - what is the purpose of the 'private' option in bower.json?

Tags:

json

bower

I am creating a bower.json file from scratch for the first time. I ran:

bower init

then I followed the step by step instructions. I was asked the following:

would you like to mark this package as private which prevents it from being accidentally published to the registry? (y/N)

I chose y(Yes), but I don't really understand what it means.

In my bower.json file I have the following line:

"private": true,

What is the purpose of this option?

like image 790
jmancherje Avatar asked Feb 09 '23 03:02

jmancherje


2 Answers

If you create a package and if you want that package not to be listed in bower search then you have to pass the flag private to be true.

http://bower.io/search/

like image 93
Raja Sekar Avatar answered Feb 12 '23 11:02

Raja Sekar


Saying you are located in a folder which is the root folder of the bower package you are currently developing to package your new custom library.

The command bower register <package-name> <git-repo-url> will register the current bower package to the declared bower registry (by default, bower.herokuapp.com, but you can override it by your private bower package registry).

... unless your bower.json file contain the private:true option. If so, bower will cancel registring your package to your configured registry.

like image 22
Rémi Becheras Avatar answered Feb 12 '23 09:02

Rémi Becheras