Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the "private" flag yarn init?

Tags:

yarnpkg

When I run yarn init one of the questions is question private. I searched everywhere but couldn't find an explaination for that. What does it mean private in this context?

like image 436
Cris Avatar asked Jul 06 '18 11:07

Cris


People also ask

What is yarn init?

The yarn init command is a command used to create or update a package. json file interactively. yarn init. when you run this command from the terminal, it will walk you through an interactive session to create a package. json file.

Where does yarn pull packages from?

Most packages will be installed from the npm registry and referred to by simply their package name. For example, yarn add react will install the react package from the npm registry.

Which registry does yarn use?

By default, the Yarn CLI uses a different registry, and not the original one: https://registry.yarnpkg.com .


1 Answers

yarn init is meant to assist you in the process of creating a package.json for a new project.

private means adding a private: true field in the autogenerated package.json, which will instruct npm to refuse publishing the package to the public NPM registry on npm publish.

like image 83
Andrea Carraro Avatar answered Oct 05 '22 14:10

Andrea Carraro