Getting Started
Install
As usual, you can either install yown
globally:
npm i -g yown
Or use npx
, no strings attached:
npx yown <gist_id> <gist_id> ...
What is a yown boilerplate ?
A yown is just a Github Gist.
npx yown 3f835915441c2b84890282302ad44d7f
The CLI tool downloads all the files in the Gist into the working directory.
Although specifying any Gist ID does work, there are ways to do smarter downloads:
- Specify folder to download all the files into
- Specify folder to download each file individually into
-
.patch
existing files
Specify working directory
By default yown will download all the files into the working directory (cwd
).
This can be overridden with the --dir
option:
npx yown 3f835915441c2b84890282302ad44d7f --dir app/config
All the files in the Gist would be downloaded inside the ./app/config/
folder instead of the working directory ./
.
Alternatively you can add a special yown.json
file to your Gist, and specify the default dir
option in it:
{
"dir": "app/config"
}
Note
CLI
--dir
option supersedesyown.json
dir option.
Specify folder in file name
Since it is not allowed to write a file path as a Gist file name, yown comes with its own workaround:
Use back slashes (\
) instead of forward slashes (/
) in file names: app\config\index.js
.
The index.js
file would be downloaded into the ./app/config/
folder.
Notes
- Yown does not replace a file if
git
is detected and the file is not clean- Yown creates all non-existing folders
Patch existing files
In order to download and apply a patch,
just append .patch
to your Gist file name: app\views\atoms\index.js.patch
.
@@ -0 +0 @@
+export { default as Button } from './button';
+
Notes
- Yown uses the unified
diff
format- Yown ignores the
diff
file names header (--- from-file
,+++ to-file
)- Yown does not patch a file if
git
is detected and the file is not clean- Yown creates all non-existing files to patch
Boilerplate scoped name
While you can download a Gist by ID:
npx yown 3f835915441c2b84890282302ad44d7f
It might be easier to share them with your team with a name:
npx yown @<username>/<name>
You can name a boilerplate at yown.org and it will also come with a file explorer to showcase all the boilerplate files.
Boilerplate is ❤️. Happy coding.