npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

template-push

0.1.1

@jonschlinkert

npmHomeRepoSnykSocket
Downloads:6
$ npm install template-push
DailyWeeklyMonthlyYearly

template-push NPM version

Push template collections in a vinyl stream.

Based on assemble-push, by @doowb

Install with npm

npm i template-push --save

Usage

var push = require('template-push');

API

push

Returns a function that takes the current instance of app.

Params

  • app {Object}: Instance of app.
  • returns {Function}: Factory function used to build a stream.

Example

var app = require('your-app');
var appPush = require('template-push')(app);

appPush

Returns a stream that pushes a collection of templates onto a stream as vinyl file objects.

Params

  • name {String}: Name of the collection to push into the stream.
  • returns {Stream}: Stream used in piping objects through.

Example

// create a new arbitrary template type (collection)
app.create('foo', {isRenderable: true});

// Load `foo` templates
app.foo('about-app.md', {content: '...'});

// push the `foo` collection into the stream to be rendered
app.task('default', function () {
  appPush('foo').pipe(app.dest('dist/'));
});

Related projects

  • assemble: Static site generator for Grunt.js, Yeoman and Node.js. Used by Zurb Foundation, Zurb Ink, H5BP/Effeckt,… more
  • template: Render templates using any engine. Supports, layouts, pages, partials and custom template types. Use template… more
  • verb: Documentation generator for GitHub projects. Extremely powerful, easy to use, can generate anything from API… more

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

  • github/jonschlinkert
  • twitter/jonschlinkert

License

Copyright (c) 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on April 27, 2015.