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?
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.
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.
By default, the Yarn CLI uses a different registry, and not the original one: https://registry.yarnpkg.com .
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With