slugger-unique
v1.0.1
Published
Create slugs using slugger while ensuring they are unique.
Downloads
18
Maintainers
Readme
slugger-unique
Create slugs using slugger while ensuring they are unique.
Install
npm install slugger-unique
Usage
var SluggerUnique = require('slugger-unique')
var slugger = new SluggerUnique()
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'
Contributing
Contributions welcome! Please read the contributing guidelines first.