#slug #url #generator #slugify #utility #generated #node

el-slugify

URL slug generator utility. Slugs are generated efficiently, fast, they are transliterated and sanitized for use in URLs.

2 releases

0.1.1 Feb 2, 2023
0.1.0 Feb 2, 2023

#4 in #slugify

Download history 12/week @ 2023-12-19 11/week @ 2023-12-26 30/week @ 2024-01-02 5/week @ 2024-01-09 39/week @ 2024-01-16 64/week @ 2024-01-23 56/week @ 2024-01-30 4/week @ 2024-02-06 6/week @ 2024-02-13 29/week @ 2024-02-20 117/week @ 2024-02-27 49/week @ 2024-03-05 32/week @ 2024-03-12 31/week @ 2024-03-19 32/week @ 2024-03-26 71/week @ 2024-04-02

170 downloads per month
Used in flatlake

MIT license

7KB
73 lines

EL-SLUGIFY

URL slug generator utility. Slugs are generated efficiently, fast, they are transliterated and sanitized for use in URLs.

What makes a good slug?

  • transliterated
  • lowercased
  • sanitized

You can use el_slugify in your rust and node projects.

Example in Rust

Dependencies:

[dependencies]
el-slugify = "0.1.0"

And use:


use el_slugify::{slugify, slugify_with_replacement};

assert_eq!(slugify("#% MaČKA mački grize rep! (RIB-a) ~*"), "macka-macki-grize-rep-rib-a");
assert_eq!(slugify_with_replacement("#% MaČKA mački grize rep! (RIB-a) ~*", '_'), "macka_macki_grize_rep_rib_a");

Example in Node

Node module reuses functionality from el_slugify crate.

Dependencies:

npm i --save node-el-slugify

And use:

const slugifier = require("node-el-slugify");

assert.strictEqual(slugifier.slugify('mačka Mački Grize rep!'), 'macka-macki-grize-rep')
assert.strictEqual(slugifier.slugify_with_replacement('mačka Mački Grize rep!', '_'), 'macka_macki_grize_rep')

License

MIT © Eisberg Labs

Dependencies

~180KB