
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
sluggo is a slug generator that:
npm install sluggo
var sluggo = require('sluggo');
var s = sluggo('@ monkey\'s are elab؉؉orate fools##');
console.log(s);
Outputs:
monkey-s-are-elab-orate-fools
Change the string separator by passing a string (usually one character) to separator
.
const sluggo = require('sluggo');
const s = sluggo('monkey\'s are elaborate fools', {
separator: ','
});
console.log(s);
Outputs:
monkey,s,are,elaborate,fools
Set a single-character string to allow in returned strings. Otherwise all punctuation characters are replaced by the separator.
const sluggo = require('sluggo');
const s = sluggo('@ monkey\'s are elab؉؉orate fools##', {
allow: '؉'
});
console.log(s);
Outputs:
monkey-s-are-elab؉؉orate-fools
You just want sluggo.js
. Add that file to your frontend javascript world.
Now you can call the sluggo()
function anywhere.
You do NOT need generator.js
, which we will use when the next version of Unicode comes out to update this module.
sluggo was created at P'unk Avenue for use in ApostropheCMS, an open-source content management system built on Node.js. If you like sanitize-html you should definitely check out Apostrophe.
Feel free to open issues on Github.
allow
options property while still accepting a string. Declared stable.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.Whoops, 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.
Converts to lowercase properly.
Packaged correctly to work in either node or the browser.
Initial release.
FAQs
High-speed, unicode-aware, browser-friendly slug generator
We found that sluggo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 13 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.