helper-slugify
Slugify a URL, path or heading id using the same format as GitHub heading anchors.
Last updated 10 years ago by jonschlinkert .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install helper-slugify 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 0.2.0                                ...           latest (10 years ago)

2 Versions

  • 0.2.0                                ...           10 years ago
  • 0.1.0                                ...           13 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 1
Dependencies (1)
Dev Dependencies (4)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |