yarn init — Yarn CLI reference

Initialize a package in the current directory

Docs/Reference/CLI/init

yarn init

Initialize a package in the current directory

yarn init <TEMPLATE> <ARGS…>

This command creates a manifest and supporting project files in the current directory.

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.

When a template is provided, Yarn initializes the project, installs the template in a temporary context, and runs its binary from the new project.

#--private, -pboolean

Mark the new package as private

#--workspace, -wboolean

Configure the package as a workspace root

#--name, -nboolean

Package name to write to the manifest

#-2boolean

Hidden legacy Yarn 1 compatibility flag

#--yes, -yboolean

Hidden legacy Yarn 1 compatibility flag