kiruthiga 55473b7e7c initial push il y a 5 jours
..
node_modules 55473b7e7c initial push il y a 5 jours
test 55473b7e7c initial push il y a 5 jours
.npmignore 55473b7e7c initial push il y a 5 jours
.travis.yml 55473b7e7c initial push il y a 5 jours
CHANGELOG.md 55473b7e7c initial push il y a 5 jours
CONTRIBUTING.md 55473b7e7c initial push il y a 5 jours
LICENSE 55473b7e7c initial push il y a 5 jours
README.md 55473b7e7c initial push il y a 5 jours
index.js 55473b7e7c initial push il y a 5 jours
package.json 55473b7e7c initial push il y a 5 jours

README.md

github-slugger

npm travis

Generate a slug just like GitHub does for markdown headings. It also ensures slugs are unique in the same way GitHub does it. The overall goal of this package is to emulate the way GitHub handles generating markdown heading anchors as close as possible.

Install

npm install github-slugger

Usage

var GithubSlugger = require('github-slugger')
var slugger = new GithubSlugger()

slugger.slug('foo')
// returns 'foo'

slugger.slug('foo')
// returns 'foo-1'

slugger.slug('bar')
// returns 'bar'

slugger.slug('foo')
// returns 'foo-2'

slugger.reset()

slugger.slug('foo')
// returns 'foo'

Check test/index.js for more examples.

Contributing

Contributions welcome! Please read the contributing guidelines first.

License

ISC