helpers/helper-example

Name: helper-example

Owner: Helpers

Description: Opinionated template helper that inserts a code example from a filepath.

Created: 2016-02-26 17:59:34.0

Updated: 2016-02-26 18:00:28.0

Pushed: 2016-02-26 18:00:16.0

Homepage: null

Size: 9

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

helper-example NPM version Build Status

Opinionated template helper that inserts a code example from a filepath.

Install

Install with npm:

m install helper-example --save
Usage

Register the helper with app (verb, assemble or templates);

helper('example', require('helper-example'));

To use the helper, pass the filepath of the code example to inject and the name of the module as the second argument:

example("examples/foo.js", "foo-bar-baz") %>

If the contents of foo.js is something like this:

app = require('./');

tion foo(a, b, c) {
=> do stuff with a, b, and c
turn app(a, b, c);

'one', 'two', 'three');

The require('./') statement is converted to require('helper-example'):

app = require('helper-example');

tion foo(a, b, c) {
=> do stuff with a, b, and c
turn app(a, b, c);

'one', 'two', 'three');
Related projects
Contributing

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

Building docs

Generate readme and API documentation with verb:

m install verb && npm run docs

Or, if verb is installed globally:

rb
Running tests

Install dev dependencies:

m install -d && npm test
Author

Jon Schlinkert

License

Copyright © 2016 Jon Schlinkert Released under the MIT license.


This file was generated by verb, v0.9.0, on February 26, 2016.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.