node-stamp

Generate scaffolding from mustache templates and YAML files using Node.js

stamp

Generate scaffolding from mustache templates and YAML files using Node.js

Install the module with: npm install stamp

In Javascript:

var stamp = require('stamp');
var data = {
options: {
baseTemplatePath: 'templates',
baseOutPath: 'out',
// whitelist: ['out/example1/example.js'] 
// blacklist: ['out/example1/nested/example.js'] 
},
dirs: [
{
name: 'example1',
files: [
{
template: 'example.js',
data: { name: 'Trevor' }
},
{
template: 'example.js',
name: 'exampleAlt.js',
data: { name: 'Stamp' }
}
],
children: [
{
name: 'nested',
files: [
{
template: 'example.js',
data: {name: 'Nested'}
}
]
}
]
}
]
}
stamp(data);

From the Command Line:

node stamp.js path/to/yaml/config.yml

Where config.yml presents the same structure.

  • could use some unit tests

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

0.2.0 3/21/13 - optionally whitelist or blacklist based on relative filepath. 0.1.0: 3/20/13 - initial release.

Copyright (c) 2013 Trevor Borg
Licensed under the MIT license.