
Security News
npm Introduces minimumReleaseAge and Bulk OIDC Configuration
npm rolls out a package release cooldown and scalable trusted publishing updates as ecosystem adoption of install safeguards grows.
boilerplate
Advanced tools
Tools and conventions for authoring and publishing boilerplates that can be generated by any build system or generator.
Tools and conventions for authoring and publishing boilerplates that can be generated by any build system or generator.
Welcome to boilerplate! Here you'll find both the tools and conventions for creating project boilerplates.
(Table of contents generated by verb)
This example shows how easy it is to convert an existing project into a Boilerplate project using the most popular boilerplate of them all: html5-boilerplate.
First, install boilerplate and html5-boilerplate:
$ npm i boilerplate && git clone https://github.com/h5bp/html5-boilerplate.git vendor/h5bp
The following examples returns a normalized configuration object for every file in the html5-boilerplate project, organized exactly the way the project itself is organized.
var Boilerplate = require('boilerplate');
var h5bp = new Boilerplate({
options: {
cwd: 'vendor/h5bp/dist'
},
root: {src: ['{.*,*.*}'], dest: 'src/'},
css: {src: ['css/*.css'], dest: 'src/'},
doc: {src: ['doc/*.md'], dest: 'src/'},
js: {src: ['js/**/*.js'], dest: 'src/'}
});
console.log(h5bp);
Results in the following object:
{
options: {
cwd: 'vendor/h5bp/dist'
},
config: {},
targets: {
root: {
options: {
cwd: 'vendor/h5bp/dist'
},
files: [
{
src: [
'vendor/h5bp/dist/.DS_Store',
'vendor/h5bp/dist/.editorconfig',
'vendor/h5bp/dist/.gitattributes',
'vendor/h5bp/dist/.gitignore',
'vendor/h5bp/dist/.htaccess',
'vendor/h5bp/dist/404.html',
'vendor/h5bp/dist/apple-touch-icon.png',
'vendor/h5bp/dist/browserconfig.xml',
'vendor/h5bp/dist/crossdomain.xml',
'vendor/h5bp/dist/favicon.ico',
'vendor/h5bp/dist/humans.txt',
'vendor/h5bp/dist/index.html',
'vendor/h5bp/dist/LICENSE.txt',
'vendor/h5bp/dist/robots.txt',
'vendor/h5bp/dist/tile-wide.png',
'vendor/h5bp/dist/tile.png'
],
dest: 'src/',
options: {
cwd: 'vendor/h5bp/dist'
},
name: 'scaffold'
}
]
},
css: {
options: {
cwd: 'vendor/h5bp/dist'
},
files: [
{
src: [
'vendor/h5bp/dist/css/main.css',
'vendor/h5bp/dist/css/normalize.css'
],
dest: 'src/',
options: {
cwd: 'vendor/h5bp/dist'
},
name: 'scaffold'
}
]
},
doc: {
options: {
cwd: 'vendor/h5bp/dist'
},
files: [
{
src: [
'vendor/h5bp/dist/doc/css.md',
'vendor/h5bp/dist/doc/extend.md',
'vendor/h5bp/dist/doc/faq.md',
'vendor/h5bp/dist/doc/html.md',
'vendor/h5bp/dist/doc/js.md',
'vendor/h5bp/dist/doc/misc.md',
'vendor/h5bp/dist/doc/TOC.md',
'vendor/h5bp/dist/doc/usage.md'
],
dest: 'src/',
options: {
cwd: 'vendor/h5bp/dist'
},
name: 'scaffold'
}
]
},
js: {
options: {
cwd: 'vendor/h5bp/dist'
},
files: [
{
src: [
'vendor/h5bp/dist/js/main.js',
'vendor/h5bp/dist/js/plugins.js',
'vendor/h5bp/dist/js/vendor/jquery-1.11.3.min.js',
'vendor/h5bp/dist/js/vendor/modernizr-2.8.3.min.js'
],
dest: 'src/',
options: {
cwd: 'vendor/h5bp/dist'
},
name: 'scaffold'
}
]
}
}
}
What is a boilerplate?
A boilerplate is a project with generic, reusable code, files or content that is intended to be used as a starting point for creating new projects.
What does this project provide?
What does this NOT provide?
Workflows and tools for actually generating new projects from a boilerplate. This is a job much better suited to build systems like assemble, gulp, grunt, and yeoman.
If you publish a library that works with Boilerplate, please let us know about it!
Install with npm
$ npm i boilerplate --save
var boilerplate = require('boilerplate');
Create an instance of Boilerplate with the given options
Params
options {Object}Example
var boilerplate = new Boilerplate({
templates: {
files: [{src: 'templates/*.hbs', dest: 'src/'}]
}
});
Register a boilerplate target with the given name and configuration options. A target is just a way to organize the files or content of a boilerplate into smaller groups.
Params
name {String}: The name of the target.config {Object}: The configuration to use.returns {Object}Example
boilerplate.target('webapp', ...);
As of September 04, 2015:
Statements : 100% (40/40)
Branches : 100% (24/24)
Functions : 100% (4/4)
Lines : 100% (39/39)
Install dev dependencies:
$ npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Jon Schlinkert
Copyright © 2015 Jon Schlinkert Released under the MIT license.
This file was generated by verb-cli on September 04, 2015.
FAQs
Tools and conventions for authoring and using declarative configurations for project "boilerplates" that can be consumed by any build system or project scaffolding tool.
The npm package boilerplate receives a total of 18 weekly downloads. As such, boilerplate popularity was classified as not popular.
We found that boilerplate demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
npm rolls out a package release cooldown and scalable trusted publishing updates as ecosystem adoption of install safeguards grows.

Security News
AI agents are writing more code than ever, and that's creating new supply chain risks. Feross joins the Risky Business Podcast to break down what that means for open source security.

Research
/Security News
Socket uncovered four malicious NuGet packages targeting ASP.NET apps, using a typosquatted dropper and localhost proxy to steal Identity data and backdoor apps.