
Security News
NVD Concedes Inability to Keep Pace with Surging CVE Disclosures in 2025
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
byoboilerplate
Advanced tools
A simple, customizable code generator for the command line. Inspired by the rails generate command. Uses the Liquid templating language.
[ALPHA] A simple, customizable code generator for the command line.
Inspired by the rails generate
command. Written in NodeJS. Uses the Liquid templating language.
BYOBoilerplate lets you generate boilerplate code easily, however you like it.
bgen component MyComponent
src
└── components
└── MyComponent
├── MyComponent.component.js
├── MyComponent.styles.js
└── index.js
I'm a React / Redux programmer, and I find myself repeatedly copying and pasting folder structure to create a new component, view, set of reducers, and so on, then changing the finer details in each one. And I hate repeating myself.
And I hate repeating myself.
Use BYOBoilerplate:
These are sample generators that come packaged with BYOBoilerplate. They're written for React / Redux, just because I use those things a lot. Write your own, for any language. But you can easily create your own generators.
bgen component MyComponent
src
└── components
└── MyComponent
├── MyComponent.component.js
├── MyComponent.styles.js
└── index.js
bgen view MyView
src
└── views
└── MyView
├── MyView.view.js
├── MyView.styles.js
└── index.js
With npm
:
npm i --save-dev byoboilerplate
With yarn
:
yarn add --dev byoboilerplate
Then run bgen init
from your project's root folder to generate your default byoboilerplate.json
and templates
folder.
Add your code templates (written in Liquid) to a folder of your choosing (/templates
by default).
byobconfig.json
.Edit the packaged byobconfig.json
to create or modify your generator settings. See the example byobconfig.json
below.
npm run generate **generatorName** **instanceName**.
You just saved some time.
The following settings are in byobconfig.json
and can be edited as needed:
Property | Description |
---|---|
templatesDir | Base directory of your templates. Subfolders should be named after generators (e.g., "component", "view", "chicken", etc) |
outputBaseDir | Base directory for generated output. |
generators | Object. Keys are generator names (which you will pass to bgen ; values are the settings for that generator. |
generators.templateSubDir | The subdirectory of templatesDir containing this generator's template files. |
generators.outputSubdir | The subdirectory of outputBaseDir where this generator's output will go. Can contain Liquid markup, and can be a partial path (path/to/subdir). |
generators.templates | Object. Keys are source files inside templateSubDir ; values are filenames to output inside outputSubDir , and contain Liquid markup. |
See the sample byobconfig.json
(below, or created with bgen init
) for examples of all the above.
byobconfig.json
This comes packaged with BYOBoilerplate. Add or edit as needed.
{
"templatesDir": "templates",
"outputBaseDir": "src",
"generators": {
"component": {
"templateSubDir": "component",
"outputSubDir": "components/{{INSTANCE_NAME}}",
"templates": {
"component.js.liquid": "{{INSTANCE_NAME}}.component.js",
"index.js.liquid": "index.js",
"styles.js.liquid": "{{INSTANCE_NAME}}.styles.js"
}
},
"view": {
"templateSubDir": "view",
"outputSubDir": "views/{{INSTANCE_NAME}}",
"templates": {
"view.js.liquid": "{{INSTANCE_NAME}}.view.js",
"index.js.liquid": "index.js",
"styles.js.liquid": "{{INSTANCE_NAME}}.styles.js"
}
}
}
}
There's some core test coverage currently. Run npm test
or yarn test
from the source folder.
FAQs
A simple, customizable code generator for the command line. Inspired by the rails generate command. Uses the Liquid templating language.
The npm package byoboilerplate receives a total of 7 weekly downloads. As such, byoboilerplate popularity was classified as not popular.
We found that byoboilerplate demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.