# helper-slugify [![NPM version](https://img.shields.io/npm/v/helper-slugify.svg?style=flat)](https://www.npmjs.com/package/helper-slugify) [![NPM downloads](https://img.shields.io/npm/dm/helper-slugify.svg?style=flat)](https://npmjs.org/package/helper-slugify) [![Build Status](https://img.shields.io/travis/jonschlinkert/helper-slugify.svg?style=flat)](https://travis-ci.org/jonschlinkert/helper-slugify)

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

## Usage

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

**Lo-Dash usage**

Usage with [lodash](https://lodash.com/):

```js
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](https://github.com/jonschlinkert/engine):

```js
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

* [handlebars-helpers](https://www.npmjs.com/package/handlebars-helpers): More than 130 Handlebars helpers in ~20 categories. Helpers can be used with Assemble, Generate… [more](https://github.com/assemble/handlebars-helpers) | [homepage](https://github.com/assemble/handlebars-helpers "More than 130 Handlebars helpers in ~20 categories. Helpers can be used with Assemble, Generate, Verb, Ghost, gulp-handlebars, grunt-handlebars, consolidate, or any node.js/Handlebars project.")
* [helper-reflinks](https://www.npmjs.com/package/helper-reflinks): Async template helper for generating a list of markdown reference links. | [homepage](https://github.com/helpers/helper-reflinks "Async template helper for generating a list of markdown reference links.")
* [helper-related](https://www.npmjs.com/package/helper-related): Template helper for generating a list of links to the homepages of related GitHub/npm projects. | [homepage](https://github.com/helpers/helper-related "Template helper for generating a list of links to the homepages of related GitHub/npm projects.")
* [template-helpers](https://www.npmjs.com/package/template-helpers): Generic JavaScript helpers that can be used with any template engine. Handlebars, Lo-Dash, Underscore, or… [more](https://github.com/jonschlinkert/template-helpers) | [homepage](https://github.com/jonschlinkert/template-helpers "Generic JavaScript helpers that can be used with any template engine. Handlebars, Lo-Dash, Underscore, or any engine that supports helper functions.")

### Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).

### Running tests

Install dev dependencies:

```sh
$ npm install -d && npm test
```

### Author

**Jon Schlinkert**

* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)

### License

Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT license](https://github.com/jonschlinkert/helper-slugify/blob/master/LICENSE).

***

_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on July 19, 2016._