slug-factory

Unique slug generator for node.js

Usage no npm install needed!

<script type="module">
  import slugFactory from 'https://cdn.skypack.dev/slug-factory';
</script>

README

slug-factory

Unique Slug Generator for node.js.

Installation

npm install slug-factory

Usage

var slugFactory = require('slug-factory');
var exists = 4;

function iterator(path, cb) {
  exists--;
  cb(null, exists);
}

slugFactory('Slugen ips³ón.', iterator, function(err, slug) {
  console.log(slug); // slugen-ipson-3
});

Test

mocha

Cheers.