Skip to content
Lo-Dash, Underscore.string + some other useful functions
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
test
.gitignore
.jshintrc
.travis.yml
LICENSE
README.md
lodashed.js
package.json
test.js

README.md

LoDashed

Build Status Dependency Status NPM version

Lo-Dash, Underscore.string + some other useful functions in a single, powerful _.

The "other" functions

.type( [variable] )

Return the type of a variable as a string.

_.type([]); // => array
_.type(new Array()); // => array
_.type({}); // => object
_.type(new Object()); // => object

.uncapitalize( [str] )

Uncapitalize an string.

_.uncapitalize( "I AM MAD!" ); // "i AM MAD!"
_.uncapitalize( "you're my hero!" ); // "you're my hero!"

.replaceAll( str, token, newToken[, ignoreCase])

Replace all occurrences of an string, optionally checking the case.

_.replaceAll( "Anakin Skywalker was the best jedi!", "Anakin", "Luke" ); // => Luke Skywal...
_.replaceAll( "Anakin Skywalker was the best jedi!", "anakin", "Luke" ); // => Anakin Skywal...
_.replaceAll( "Anakin Skywalker was the best jedi!", "anakin", "Luke", true ); // => Luke Skywal...

.uuid()

Returns an UUID v4.

_.uuid(); // => "9279f99f-0525-4079-95a6-3580ef272e71"

.byteFormat( bytes[, decimals=0][, decimalSeparator="."][, orderSeparator=","] )

Format an byte size, e.g. 1024 becomes 1 KB. You can also customize the output by providing how much decimals you want and a decimalSeparator and orderSeparator.

_.byteFormat( 1024 ); // => "1 KB"
_.byteFormat( 1024 * 100 ); // => "100 KB"

Tests

Run the following commands inside the project root:

npm install
npm test

License

MIT

Something went wrong with that request. Please try again.