lex-sort

0.0.2 • Public • Published

lex-sort

Use this module to sort an array of strings based on an arbitrary lexicographic ordering.

Babel transpilation is not set up so please use Node 4.0+

Example usage:

var sort = require('lex-sort')
 
// Pass in an array of strings to sort and a string representing desired order
var sorted = sort(["acb", "abc", "bca"], "abc")
 
console.log(sorted) //--> [ 'abc', 'acb', 'bca' ]

I also set up 3 tests which can be run via npm test.

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i lex-sort

    Weekly Downloads

    4

    Version

    0.0.2

    License

    MIT

    Last publish

    Collaborators

    • nmai