Hygen is a code generator that saves you time.
You can save yourself time by using it to generate a blog post template so you can start writing faster.
Install hygen, day.js, and open npm packages
Day.js is a date library which will be used for the blog post directory name.
open will open the new blog post up in your browser
Great! Now we need to create our blog post template file.
We're also going to create a prompt.js
file, which will allow us to answer a few questions when creating the blog post.
Last thing we need to do is add a script to the package.json
:
That's it! Now test it out!
Using npm:
npm run g:post
Using yarn:
yarn g:post
To read more about Hygen's handy helpers and inflections, check out the docs