underscore.string
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
The underscore.string package is a string manipulation utility module for JavaScript, specifically engineered to fill the gap of missing string manipulation operations. It began as an extension for the popular Underscore.js library, but today it stands as a standalone library.
To use underscore.string in your projects, you can start by installing it from npm using the command npm install underscore.string
. You can then proceed to require individual functions like this:
var slugify = require("underscore.string/slugify");
slugify("Hello world!");
// Output: hello-world
Or load the full library to enable chaining as such:
var s = require("underscore.string");
s(" epeli ").trim().capitalize().value();
// Output: "Epeli"
If you are using the Meteor framework, you can add the library to your project using the command meteor add underscorestring:underscore.string
and access it via the s
global from both the server and the client side.
The library can also work with AMD loaders like RequireJS or directly added to a webpage and accessed via the s
global.
For Underscore.js/Lo-Dash integration, this package is not recommended as it would result in some conflicts since include
, contains
, reverse
, and join
are dropped due to name clashes. However, you can consider using underscore.string.fp for seamless Lo-Dash-FP/Ramda integration.
The full documentation for underscore.string, including all its available functions and usage aspects, can be found on https://epeli.github.io/underscore.string/. From string trimming, capitalization, slugification, levenshtein distance calculation, chopping, diacritic removal, and more, all these are comprehensively covered in the document. By referring to this documentation, developers can unlock the exhaustive capabilities of underscore.string for their JavaScript projects.