
Security News
OpenClaw Advisory Surge Highlights Gaps Between GHSA and CVE Tracking
A recent burst of security disclosures in the OpenClaw project is drawing attention to how vulnerability information flows across advisory and CVE systems.
Conventions and API for creating declarative configuration objects for project scaffolds - similar in format to a grunt task, but more portable, generic and can be used by any build system or generator - even gulp.
Conventions and API for creating declarative configuration objects for project scaffolds - similar in format to a grunt task, but more portable, generic and can be used by any build system or generator - even gulp.
What is a scaffold? | gulp-scaffold-example
(TOC generated by verb using markdown-toc)
Mainly the following two things:
(To see the opposite of what this project hopes to achieve, take a look at a generator from Google's Yeoman. Yeoman is a node.js application that generates projects from "scaffolding", which includes templates, project metadata, and so on. But it does so in a way that completely couples these things with application logic, making it difficult or tedious to make the components reusable by anything but yeoman).
Example
The following scaffold "expands" into a configuration object that can be passed to gulp, grunt, assemble, metalsmith, or even yeoman for scaffolding out various parts of a blog or site (like adding a new post, UI component, etc):
var Scaffold = require('scaffold');
var scaffold = new Scaffold({
posts: {
src: 'templates/post.md',
dest: 'blog/'
},
components: {
cwd: 'content',
src: ['templates/*.hbs'],
dest: 'blog/'
}
});
Example result
The above scaffold might expand into something like the following:
{
options: {},
blog: {
options: {cwd: 'blog'},
files: [
{
src: ['content/post.md', 'content/about.md'],
dest: 'src/posts/'
},
{
src: ['data/ipsum.json'],
dest: 'src/data/'
}
]
},
components: {
options: {cwd: 'ui'},
files: [
{
options: {cwd: 'templates/layouts'},
src: ['default.hbs', '3-column.hbs'],
dest: 'src/templates/layouts'
},
{
options: {cwd: 'templates/components'},
src: ['button.hbs', 'modal.hbs', 'navbar.hbs'],
dest: 'src/templates/partials'
},
{
src: ['scripts/button.js'],
dest: 'src/assets/js/'
},
{
src: ['data/ipsum.json'],
dest: 'src/assets/data/'
}
]
}
}
Since we're just creating an object (with zero application logic), anything can obviously be extended, overridden, etc.
Install with npm:
$ npm i scaffold --save
Create an instance of scaffold:
var Scaffold = require('scaffold');
var foo = new Scaffold({
// config/options here
});
Scaffold uses expand-target and expand-files as dependencies. Visit those projects for the full range of available features and options:
The following are just a few random examples of what a scaffold could be, but there are many more use cases.
Blog posts
Create a scaffold for adding blog posts to a project:
var blog = new Scaffold({
post: {
cwd: 'content',
src: 'content/post.md',
dest: 'src/posts/'
}
});
UI components
Create a scaffold for adding UI components to a project:
var components = new Scaffold({
foo: {
options: {cwd: 'scaffolds'},
files: [
{src: 'templates/component.hbs', dest: 'src/templates/'},
{src: 'scripts/component.js', dest: 'src/scripts/'},
{src: 'styles/component.css', dest: 'src/styles/'},
]
}
});
Create a new Scaffold with the given options
Params
options {Object}Example
var scaffold = new Scaffold({cwd: 'src'});
scaffold.addTargets({
site: {src: ['*.hbs']},
blog: {src: ['*.md']}
});
Add targets to the scaffold, while also normalizing src-dest mappings and expanding glob patterns in each target.
Params
scaffold {Object}: Scaffold object with targets, options, or arbitrary properties.returns {Object}Example
scaffold.addTargets({
site: {src: '*.hbs', dest: 'templates/'},
docs: {src: '*.md', dest: 'content/'}
});
Add a single target to the scaffold, while also normalizing src-dest mappings and expanding glob patterns in the target.
Params
name {String}config {Object}returns {Object}Example
scaffold.addTarget('foo', {
src: '*.hbs',
dest: 'templates/'
});
A scaffold consists of one or more templates or source files and serves as a "temporary support structure" that may be used to initialize a new project, or to provide ad-hoc "components" throughout the duration of a project.
What does this project do?
Given the above definition, this project provides an API for creating configuration objects with various details about a scaffold, such as source file paths or glob patterns, destination paths, default settings, and so on.
The resulting object could be described as a "scaffold configuration" or "scaffold manifest".
The following table describes the difference between boilerplates, scaffolds and templates.
| type | description |
|---|---|
| template | Resuable file, code or content which contains "placeholder" values that will eventually be replaced with real values by a rendering (template) engine |
| scaffold | Consists of one or more templates or source files and serves as a "temporary support structure" that may be used to initialize a new project, or to provide ad-hoc "components" throughout the duration of a project. |
| boilerplate | Boilerplates consist of all of the necessary files required to initialize a complete project. |
As of January 06, 2016:
Statements : 100% (29/29)
Branches : 100% (18/18)
Functions : 100% (3/3)
Lines : 100% (28/28)
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 © 2016 Jon Schlinkert Released under the MIT license.
This file was generated by verb on January 06, 2016.
FAQs
Conventions and API for creating declarative configuration objects for project scaffolds - similar in format to a grunt task, but more portable, generic and can be used by any build system or generator - even gulp.
The npm package scaffold receives a total of 43 weekly downloads. As such, scaffold popularity was classified as not popular.
We found that scaffold 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
A recent burst of security disclosures in the OpenClaw project is drawing attention to how vulnerability information flows across advisory and CVE systems.

Research
/Security News
Mixed-script homoglyphs and a lookalike domain mimic imToken’s import flow to capture mnemonics and private keys.

Security News
Latio’s 2026 report recognizes Socket as a Supply Chain Innovator and highlights our work in 0-day malware detection, SCA, and auto-patching.