https://github.com/assemble/assemble-render-file
Assemble pipeline plugin for rendering templates in vinyl files.
https://github.com/assemble/assemble-render-file
assemble assemble-pipeline-plugin assemble-plugin engine render
Last synced: about 1 year ago
JSON representation
Assemble pipeline plugin for rendering templates in vinyl files.
- Host: GitHub
- URL: https://github.com/assemble/assemble-render-file
- Owner: assemble
- License: mit
- Created: 2015-10-10T15:36:30.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-05-19T21:01:47.000Z (about 9 years ago)
- Last Synced: 2025-03-23T00:05:16.763Z (about 1 year ago)
- Topics: assemble, assemble-pipeline-plugin, assemble-plugin, engine, render
- Language: JavaScript
- Size: 44.9 KB
- Stars: 4
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# assemble-render-file [](https://www.npmjs.com/package/assemble-render-file) [](https://npmjs.org/package/assemble-render-file) [](https://npmjs.org/package/assemble-render-file) [](https://travis-ci.org/assemble/assemble-render-file)
> Assemble plugin for rendering views in a vinyl pipeline.
## Install
Install with [npm](https://www.npmjs.com/):
```sh
$ npm install --save assemble-render-file
```
## Usage
```js
var renderFile = require('assemble-render-file');
var assemble = require('assemble');
// register as an instance plugin with assemble
var app = assemble()
.use(renderFile());
// then use in a vinyl pipeline
app.src('*.hbs')
.pipe(app.renderfile())
.pipe(app.dest('foo'));
```
### noop engine
By default, when no engine is found for a file an error is thrown. To get around this you can either define a `noop` engine, or use disable the [engineStrict option](#optionsengineStrict).
A noop engine follows the same signature as any engine, but must be registered using the key: `noop`.
**Example**
```js
app.engine('noop', function(view, opts, next) {
// do whatever you want to `view`, or nothing
next(null, view);
});
```
## Options
### options.engineStrict
By default, when no engine is found for a file an error is thrown. This can be disabled with the following:
```js
app.option('engineStrict', false);
```
When disabled and an engine is not found, files are just passed through.
## About
### Related projects
* [assemble-loader](https://www.npmjs.com/package/assemble-loader): Assemble plugin (^0.6.0) for loading globs of views onto custom view collections. Also works with… [more](https://github.com/assemble/assemble-loader) | [homepage](https://github.com/assemble/assemble-loader "Assemble plugin (^0.6.0) for loading globs of views onto custom view collections. Also works with verb or other Templates.js based applications.")
* [assemble-streams](https://www.npmjs.com/package/assemble-streams): Assemble pipeline plugin for pushing views into a vinyl stream. | [homepage](https://github.com/assemble/assemble-streams "Assemble pipeline plugin for pushing views into a vinyl stream.")
* [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble "Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit")
* [base](https://www.npmjs.com/package/base): base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… [more](https://github.com/node-base/base) | [homepage](https://github.com/node-base/base "base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting with a handful of common methods, like `set`, `get`, `del` and `use`.")
* [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [homepage](https://github.com/verbose/verb "Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.")
### Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
### Contributors
| **Commits** | **Contributor** |
| --- | --- |
| 65 | [jonschlinkert](https://github.com/jonschlinkert) |
| 11 | [doowb](https://github.com/doowb) |
### Building docs
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
To generate the readme, run the following command:
```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```
### Running tests
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
```sh
$ npm install && npm test
```
### Author
**Jon Schlinkert**
* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
### License
Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
MIT
***
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.2, on February 20, 2017._