el-slugify 0.1.1

URL slug generator utility. Slugs are generated efficiently, fast, they are transliterated and sanitized for use in URLs.
Documentation
  • Coverage
  • 100%
    3 out of 3 items documented2 out of 3 items with examples
  • Size
  • Source code size: 6.51 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 257.6 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • amarjanica/el-slugify
    0 0 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • amarjanica

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