1.0.1 • Published 7 years ago

nunjucks-scaffold-generator v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Nunjucks Scaffold Generator

Node tool to generate scaffolds using the Nunjucks template engine.

npm i -S nunjucks-scaffold-generator

Sample usage

const {scaffold} = require('nunjucks-scaffold-generator');

const templateParams = {
  yourCustomVar: 'something',
  yourCustomFunction: camelCase
};

scaffold({
  src: 'my/custom/templates',
  dest: 'destiny/path',
  replacement: ['my-template', 'new-name'],
  params: templateParams
});

The files in the folder specified in the src param will be copied into the location specified in dest param rendered by Nunjucks. File names that dont't match the replacement pattern are preserved.

scaffold() params

ParamTypeDescription
srcStringPath to the source templates.
destStringDestiny for the generated scaffold.
replacementArray['pattern', 'replacement'] Optional replacement for the filenames of the source templates.
paramsObjectParams used by the Nunjucks templates.