{"id":13528003,"url":"https://github.com/dodo/node-slug","last_synced_at":"2025-05-16T03:03:40.285Z","repository":{"id":1689755,"uuid":"2417811","full_name":"dodo/node-slug","owner":"dodo","description":"slugifies even utf-8 chars!","archived":false,"fork":false,"pushed_at":"2019-04-05T15:49:19.000Z","size":466,"stargazers_count":1073,"open_issues_count":42,"forks_count":94,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-05-10T08:34:25.509Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dodo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-09-19T19:46:36.000Z","updated_at":"2025-03-07T03:27:43.000Z","dependencies_parsed_at":"2022-08-30T20:01:01.150Z","dependency_job_id":null,"html_url":"https://github.com/dodo/node-slug","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dodo%2Fnode-slug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dodo%2Fnode-slug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dodo%2Fnode-slug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dodo%2Fnode-slug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dodo","download_url":"https://codeload.github.com/dodo/node-slug/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254459082,"owners_count":22074604,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T06:02:09.803Z","updated_at":"2025-05-16T03:03:35.274Z","avatar_url":"https://github.com/dodo.png","language":"CoffeeScript","funding_links":[],"categories":["CoffeeScript","Modules","Uncategorized","模块"],"sub_categories":["String","Uncategorized"],"readme":"# [slug](https://github.com/dodo/node-slug)\n\nslugifies every string, even when it contains unicode!\n\nMake strings url-safe.\n\n- respecting [RFC 3986](https://tools.ietf.org/html/rfc3986)\n- Comprehensive tests\n- No dependencies (except the unicode table)\n- Not in coffee-script (except the tests lol)\n- Coerces foreign symbols to their english equivalent\n- Works in browser (window.slug) and AMD/CommonJS-flavoured module loaders (except the unicode symbols unless you use browserify but who wants to download a ~2mb js file, right?)\n\n```\nnpm install slug\n```\n\n```\nbower install slug\n```\n\n## example\n\n```javascript\nvar slug = require('slug')\nvar print = console.log.bind(console, '\u003e')\n\nprint(slug('i ♥ unicode'))\n// \u003e i-love-unicode\n\nprint(slug('unicode ♥ is ☢')) // yes!\n// \u003e unicode-love-is-radioactive\n\nprint(slug('i ♥ unicode', '_')) // If you prefer something else then `-` as seperator\n// \u003e i_love_unicode\n\nslug.charmap['♥'] = 'freaking love' // change default charmap or use option {charmap:{…}} as 2. argument\nprint(slug('I ♥ UNICODE'))\n// \u003e I-freaking-love-UNICODE\n\nprint(slug('☏-Number', {lower: true})) // If you prefer lower case\n// \u003e telephone-number\n\nprint(slug('i \u003c3 unicode'))\n// \u003e i-love-unicode\n```\n\n## options\n\n```javascript\n// options is either object or replacement (sets options.replacement)\nslug('string', [{options} || 'replacement']);\n```\n\n```javascript\nslug.defaults.mode ='pretty';\nslug.defaults.modes['rfc3986'] = {\n    replacement: '-',      // replace spaces with replacement\n    symbols: true,         // replace unicode symbols or not\n    remove: null,          // (optional) regex to remove characters\n    lower: true,           // result in lower case\n    charmap: slug.charmap, // replace special characters\n    multicharmap: slug.multicharmap // replace multi-characters\n};\nslug.defaults.modes['pretty'] = {\n    replacement: '-',\n    symbols: true,\n    remove: /[.]/g,\n    lower: false,\n    charmap: slug.charmap,\n    multicharmap: slug.multicharmap\n};\n```\n\n## browser\n\nWhen using browserify you might want to remove the symbols table from your bundle by using `--ignore` similar to this:\n```bash\n# generates a standalone slug browser bundle:\nbrowserify slug.js --ignore unicode/category/So -s slug \u003e slug-browser.js\n```\n\n[![Build Status](https://secure.travis-ci.org/dodo/node-slug.png)](http://travis-ci.org/dodo/node-slug)\n\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/dodo/node-slug/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdodo%2Fnode-slug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdodo%2Fnode-slug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdodo%2Fnode-slug/lists"}