0.1.0 • Published 9 years ago

assemble-scaffold v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

assemble-scaffold NPM version

Generate project scaffolds with assemble and Scaffold.

Install

Install with npm

$ npm i assemble-scaffold --save

Usage

var assemble = require('assemble');
var scaffold = require('assemble-scaffold');

// register the plugin, add options if needed
var app = assemble()
  .use(scaffold({cwd: 'scaffolds/'}))

Register scaffolds

Uses scaffold to create normalize configuration objects:

app.scaffold('ejs', {
  src: ['templates/ejs/*.ejs'],
  dest: 'src/templates'
});

The created configuration object looks something like:

[ { src: [ 'templates/ejs/foo.ejs', 'templates/ejs/bar.ejs' ],
    dest: 'src/templates',
    options: { cwd: 'scaffolds' },
    name: 'ejs' } ]

Generate scaffold

Which can easily be generated by calling the scaffold's generate method:

scaffold('ejs')
  // destination base is optional
  .generate('dest/', function(err) {
    if (err) console.error(err);
  });

Plugins

Plugins may also be used by passing them to the .use() method on the scaffold instance. It's also chainable.

scaffold('ejs')
  // plugins
  .use(function(config) {
    config.files.forEach(function(file) {
      // do something to `file`
    });
  })
  .use(function(config) {
    config.dest = 'foo/' + config.dest;
  })
  .generate(function(err) {
    if (err) console.error(err);
  });

Related projects

  • assemble: Static site generator for Grunt.js, Yeoman and Node.js. Used by Zurb Foundation, Zurb Ink, H5BP/Effeckt,… more | homepage
  • expand-config: Expand tasks, targets and files in a declarative configuration. | homepage
  • expand-files: Expand glob patterns in a declarative configuration into src-dest mappings. | homepage
  • scaffold: Conventions and API for creating scaffolds that can by used by any build system or… more | homepage

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on September 13, 2015.