helper-slugify

0.2.0 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i helper-slugify

Weekly Downloads

3,444

Version

0.2.0

License

MIT

Last publish

Collaborators

  • doowb
  • hariadi
  • jonschlinkert