I was reading Yarn blog and found it supports yarn create just like create-react-app.
https://yarnpkg.com/blog/2017/05/12/introducing-yarn/
I tried locally... basically made very simple application with following package.json.
{
"name": "create-test-app",
"version": "1.0.0",
"bin": {
"create-test-app": "./index.js"
},
"dependencies": {
...
}
}
But somehow,,, it is complaining that it can't find the package. "error Couldn't find package "create-test-app" on the "npm" registry.
In order to use "yarn create", I should upload on "npm" registry? Can't try it in locally? Thanks in advance.
To add to @Oluwafemi Sule 's answer.
The way to use this is yarn create <starter-kit-package>. Starter kit package must have been installed globally. You can find create-* starter kit packages in the npm registry.
This means that for it to work you need to install it to your yarn global or publish it to npm registry.
Fortunately you can install your local package globally. So start by creating a starter kit package then do this:
yarn global add file:/path/to/create-kit-package
Then after this you can do:
yarn create kit-package
In the above kit-package is the name of the package without create, since you are supposed to create the package with a name that matches the following format:
create-package-name
so on the cli you call the command as :
yarn create package-name
to invoke once it is installed globally.
You can publish this to NPM once you are happy with the package so that someone else or yourself can install it the normal way without first adding the package globally.
The way to use this is yarn create <starter-kit-package>. Starter kit package must have been installed globally. You can find create-* starter kit packages in the npm registry.
Here is the link to documentation for Yarn create
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