0.1.0 • Published 10 years ago

sluggy v0.1.0

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
10 years ago

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