https://github.com/assemble/assemble-scaffold
Assemble plugin for generating project scaffolds.
https://github.com/assemble/assemble-scaffold
Last synced: about 1 year ago
JSON representation
Assemble plugin for generating project scaffolds.
- Host: GitHub
- URL: https://github.com/assemble/assemble-scaffold
- Owner: assemble
- License: mit
- Created: 2015-09-13T20:45:48.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-09-13T21:02:32.000Z (over 10 years ago)
- Last Synced: 2025-02-16T10:15:05.341Z (over 1 year ago)
- Language: JavaScript
- Size: 129 KB
- Stars: 1
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# assemble-scaffold [](http://badge.fury.io/js/assemble-scaffold)
> Generate project scaffolds with assemble and Scaffold.
## Install
Install with [npm](https://www.npmjs.com/)
```sh
$ npm i assemble-scaffold --save
```
## Usage
```js
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](https://github.com/jonschlinkert/scaffold) to create normalize configuration objects:
```js
app.scaffold('ejs', {
src: ['templates/ejs/*.ejs'],
dest: 'src/templates'
});
```
The created configuration object looks something like:
```js
[ { 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:
```js
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.
```js
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](https://www.npmjs.com/package/assemble): Static site generator for Grunt.js, Yeoman and Node.js. Used by Zurb Foundation, Zurb Ink, H5BP/Effeckt,… [more](https://www.npmjs.com/package/assemble) | [homepage](http://assemble.io)
* [expand-config](https://www.npmjs.com/package/expand-config): Expand tasks, targets and files in a declarative configuration. | [homepage](https://github.com/jonschlinkert/expand-config)
* [expand-files](https://www.npmjs.com/package/expand-files): Expand glob patterns in a declarative configuration into src-dest mappings. | [homepage](https://github.com/jonschlinkert/expand-files)
* [scaffold](https://www.npmjs.com/package/scaffold): Conventions and API for creating scaffolds that can by used by any build system or… [more](https://www.npmjs.com/package/scaffold) | [homepage](https://github.com/jonschlinkert/scaffold)
## Running tests
Install dev dependencies:
```sh
$ npm i -d && npm test
```
## Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/assemble-scaffold/issues/new).
## Author
**Jon Schlinkert**
+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
## License
Copyright © 2015 Jon Schlinkert
Released under the MIT license.
***
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on September 13, 2015._