Docs/Reference/CLI/init

yarn init

This command will setup a new package in your local directory.

yarn init <TEMPLATE> <ARGS…>

If the -p,--private or -w,--workspace options are set, the package will be private by default.

If the -w,--workspace option is set, the package will be configured to accept a set of workspaces in the packages/ directory.

If the -i,--install option is given a value, Yarn will first download it using yarn set version and only then forward the init call to the newly downloaded bundle. Without arguments, the downloaded bundle will be latest.

The initial settings of the manifest can be changed by using the initScope and initFields configuration values. Additionally, Yarn will generate an .editorconfig file whose rules can be altered via initEditorConfig, and will initialize a Git repository in the current directory.

#--private, -pboolean

Set the package to be private

#--workspace, -wboolean

Set the package to be a workspace

#--name, -nboolean

Set the name of the package

#-2boolean
#--yes, -yboolean