sort-parser
var SortParser = require('sort-parser')
var sp = new SortParser(
{ format: SortParser.es
, fields: ['name', 'email']
, strict: true
}
)
assert.deepEquals(
sp.parse('-email,name')
, [ { 'email': 'desc' }, { 'name': 'asc' } ]
)
$ npm install sort-parser
$ npm test
MIT