{"id":18561301,"url":"https://github.com/apostrophecms/sluggo","last_synced_at":"2025-10-17T23:48:57.840Z","repository":{"id":18436265,"uuid":"21623573","full_name":"apostrophecms/sluggo","owner":"apostrophecms","description":"High-speed, unicode-aware, browser-friendly slug generator","archived":false,"fork":false,"pushed_at":"2023-05-03T18:14:43.000Z","size":25,"stargazers_count":46,"open_issues_count":0,"forks_count":2,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-03T05:30:04.391Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apostrophecms.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-07-08T17:55:06.000Z","updated_at":"2025-03-04T10:51:23.000Z","dependencies_parsed_at":"2024-06-18T18:19:28.119Z","dependency_job_id":"97798e61-8d78-4bf7-a065-4481fb31ba7f","html_url":"https://github.com/apostrophecms/sluggo","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostrophecms%2Fsluggo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostrophecms%2Fsluggo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostrophecms%2Fsluggo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostrophecms%2Fsluggo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apostrophecms","download_url":"https://codeload.github.com/apostrophecms/sluggo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248150679,"owners_count":21055966,"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-11-06T22:06:27.795Z","updated_at":"2025-10-17T23:48:52.823Z","avatar_url":"https://github.com/apostrophecms.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sluggo\n\n\u003ca href=\"https://apostrophecms.com/\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/apostrophecms/sanitize-html/main/logos/logo-box-madefor.png\" align=\"right\" alt=\"Made for ApostropheCMS\"/\u003e\u003c/a\u003e\n\nsluggo is a slug generator that:\n\n* Understands Unicode\n* Runs fast (much, much faster than a RegExp solution)\n* Replaces all runs of punctuation (in any language), control characters, whitespace, etc. with single dashes, with no leading or trailing dashes\n* Allows you to let one punctuation character through if you wish, such as a slash for pathnames\n* Allows you to change the separator character\n* Is small enough to include in your browser javascript (\u003c10K), even with the Unicode data\n\n## Installation\n\n```bash\nnpm install sluggo\n```\n\n## Usage\n\n```javascript\nvar sluggo = require('sluggo');\n\nvar s = sluggo('@ monkey\\'s are elab؉؉orate fools##');\nconsole.log(s);\n```\n\nOutputs:\n\n```\nmonkey-s-are-elab-orate-fools\n```\n\n## Options\n\n### separator\n\nChange the string separator by passing a string (usually one character) to `separator`.\n\n```javascript\nconst sluggo = require('sluggo');\n\nconst s = sluggo('monkey\\'s are elaborate fools', {\n  separator: ','\n});\nconsole.log(s);\n```\n\nOutputs:\n\n```\nmonkey,s,are,elaborate,fools\n```\n\n### allow\n\nSet a single-character string to allow in returned strings. Otherwise all punctuation characters are replaced by the separator.\n\n```javascript\nconst sluggo = require('sluggo');\n\nconst s = sluggo('@ monkey\\'s are elab؉؉orate fools##', {\n  allow: '؉'\n});\nconsole.log(s);\n```\n\nOutputs:\n\n```\nmonkey-s-are-elab؉؉orate-fools\n```\n\n## In the Browser\n\nYou just want `sluggo.js`. Add that file to your frontend javascript world.\n\nNow you can call the `sluggo()` function anywhere.\n\nYou do NOT need `generator.js`, which we will use when the next version of Unicode comes out to update this module.\n\n## About ApostropheCMS\n\nsluggo was created at [P'unk Avenue](https://punkave.com) for use in [ApostropheCMS](https://apostrophecms.com), an open-source content management system built on Node.js. If you like sanitize-html you should definitely check out Apostrophe.\n\n## Support\n\nFeel free to [open issues on Github](http://github.com/apostrophecms/sluggo/issues).\n\n## Changelog\n\n### 1.0.0 - 2023-05-03\n- Accepts an array of exceptions in the `allow` options property while still accepting a string. Declared stable.\n\n### 0.3.1 - 2021-04-23\n- Accepts the empty string as a legitimate value for `def`, as was always intended, rather than forcing `none` in that situation. If `def` is not set at all `none` is still the fallback default.\n\n### 0.3.0 - 2020-01-27\n- Updates package.json with new metadata\n- Updates README.\n\n### 0.2.0\n\nWhoops, the classic apostrophe slugify method accepted `allow`, not `allowed`. We just released this today, so I've switched to `allow` in `sluggo` as well. However I did bump to 0.2.0 to remain faithful to the semver standard.\n\n### 0.1.2\n\nConverts to lowercase properly.\n\n### 0.1.1\n\nPackaged correctly to work in either node or the browser.\n\n### 0.1.0\n\nInitial release.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapostrophecms%2Fsluggo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapostrophecms%2Fsluggo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapostrophecms%2Fsluggo/lists"}