Crates.io | el-slugify |
lib.rs | el-slugify |
version | 0.1.1 |
source | src |
created_at | 2023-02-02 16:23:25.31163 |
updated_at | 2023-02-02 16:39:46.756685 |
description | URL slug generator utility. Slugs are generated efficiently, fast, they are transliterated and sanitized for use in URLs. |
homepage | |
repository | https://github.com/eisberg-labs/el-slugify |
max_upload_size | |
id | 774894 |
size | 6,511 |
URL slug generator utility. Slugs are generated efficiently, fast, they are transliterated and sanitized for use in URLs.
What makes a good slug?
You can use el_slugify in your rust and node projects.
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");
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')