npm.io
0.2.0 • Published 13 years ago

node-stamp

Licence
Version
0.2.0
Deps
3
Vulns
1
Weekly
0

stamp

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

Getting Started

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.

Contributing

TODO
  • 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.

Release History

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

License

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

Keywords