sluggy

Slug generator module for node.js

Usage no npm install needed!

<script type="module">
  import sluggy from 'https://cdn.skypack.dev/sluggy';
</script>

README

sluggy

Slug generator module for node.js

Installation

  npm install sluggy --save

Usage

  var sluggy = require('sluggy'),
      sluggy_random = sluggy.sluggy_random,
      sluggy_string = sluggy.sluggy_string;

Random slug

  sluggy_random();
Output
    c224343bddaabd22b4bc3bbaccd2d23d

Random slug 3 groups of 5 chars

  sluggy_random(5,3);
Output
    aUFN5-69KYg-hNIYl

Random slug 2 groups of 4 chars with custom dictionary

  sluggy_random(4,2,'12345qwerty');
Output
    yy42-t3ey

Slug from string

    sluggy_string('Lorem ipsum dolor sit amet');
Output
    lorem-ipsum-dolor-sit-amet

Tests

  npm test

Release History

  • 0.1.0 Initial Release