0.2.0 • Published 8 years ago

helper-slugify v0.2.0

Weekly downloads
2,746
License
MIT
Repository
github
Last release
8 years ago

helper-slugify NPM version NPM downloads Build Status

Slugify a URL, path or heading id using the same format as GitHub heading anchors.

Usage

var slugify = require('helper-slugify');

Lo-Dash usage

Usage with lodash:

var template = require('lodash.template');
var options = {imports: {slugify: require('helper-slugify')}};

var str = template('<%= slugify("foo bar baz") %>', options)();
console.log(str);
//=> 'foo-bar-baz'

Engine usage

Usage with engine:

var Engine = require('engine');
var engine = new Engine();

engine.helper('slugify', require('helper-slugify'));

engine.render('<%= slugify("foo bar baz") %>');
console.log(str);
//=> 'foo-bar-baz'

About

Related projects

Contributing

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

Running tests

Install dev dependencies:

$ npm 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 July 19, 2016.