jsort
Simple array sorting utility supporting multiple data types.
Install
npm install --save jsort
Usage
<dataType>(array [, key])
jsort.Available data types include: text
, numeric
, currency
and date
. Default sorting order is ASC
.
jsorttext'Argentina' 'Australia' 'New Zealand' 'Ireland' 'Canada';jsort;jsort;jsort;
When a key gets passed in, jsort assumes the collection contains objects and will try to sort them by the key provided:
jsort;
<dataType>(array [, key]).reverse()
jsort.Reverse sort any array (DESC
) by using the .reverse()
method:
jsorttext'I' 'am' 'Yoda'; // returns ['Yoda', 'I', 'am']
Run Test Suite
npm test
Release Versions
git fetch
git checkout develop && git reset --hard origin/develop
npm version [<newversion> | major | minor | patch]
git checkout master && git reset --hard origin/master
git merge develop
git push --tags && git push && git checkout develop && git push
Publish the package to npm's public registry:
npm publish
To make sure everything worked just fine, go to http://npmjs.com/package/jsort.
Heads up! To publish, you must have a user on the npm registry. If you don't have one, create it with npm adduser
. If you created one on the site, use npm login
to store the credentials on the client. You can use npm config ls
to ensure that the credentials are stored on your client. Check that it has been added to the registry by going to http://npmjs.com/~.
Semantic Versioning
Given a version number MAJOR.MINOR.PATCH
, increment the:
MAJOR
version when you make incompatible API changes,MINOR
version when you add functionality in a backwards-compatible manner, andPATCH
version when you make backwards-compatible bug fixes.
Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH
format.
See the Semantic Versioning specification for more information.