{"_id":"natural-sort","_rev":"112015","name":"natural-sort","description":"Sorting with support for numbers, dates, unicode and more.","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"tomekwi","email":"t.wiszniewski@gmail.com"}],"time":{"modified":"2021-06-03T10:43:59.000Z","created":"2014-11-25T09:48:47.803Z","1.0.0":"2016-03-08T21:03:58.612Z","0.1.0":"2014-11-25T09:48:47.803Z"},"users":{"dodekeract":true},"repository":{"type":"git","url":"git+https://github.com/studio-b12/natural-sort.git"},"versions":{"1.0.0":{"name":"natural-sort","version":"1.0.0","description":"Sorting with support for numbers, dates, unicode and more.","contributors":[{"name":"Tomek Wiszniewski","email":"<t.wiszniewski@gmail.com"}],"copyright":"Studio B12 GmbH 2014","license":"MIT","main":"dist/natural-sort.js","repository":{"type":"git","url":"git+https://github.com/studio-b12/natural-sort.git"},"gitHead":"a9235c7a5680aed3d9426cae1164d3c8b835857a","bugs":{"url":"https://github.com/studio-b12/natural-sort/issues"},"homepage":"https://github.com/studio-b12/natural-sort#readme","_id":"natural-sort@1.0.0","scripts":{},"_shasum":"eac301fd86c268a771222c62dc7719402aa34380","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.4.1","_npmUser":{"name":"tomekwi","email":"t.wiszniewski@gmail.com"},"dist":{"shasum":"eac301fd86c268a771222c62dc7719402aa34380","size":3040,"noattachment":false,"key":"/natural-sort/-/natural-sort-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/natural-sort/download/natural-sort-1.0.0.tgz"},"maintainers":[{"name":"tomekwi","email":"t.wiszniewski@gmail.com"}],"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/natural-sort-1.0.0.tgz_1457471034006_0.09072722983546555"},"directories":{},"publish_time":1457471038612,"_cnpm_publish_time":1457471038612,"_hasShrinkwrap":false},"0.1.0":{"name":"natural-sort","version":"0.1.0","description":"Sorting with support for numbers, dates, unicode and more.","contributors":[{"name":"Tomek Wiszniewski","email":"<t.wiszniewski@gmail.com"}],"copyright":"Studio B12 GmbH 2014","license":"MIT","repository":{"type":"git","url":"https://github.com/studio-b12/natural-sort.git"},"bugs":{"url":"https://github.com/studio-b12/natural-sort/issues"},"homepage":"https://github.com/studio-b12/natural-sort","_id":"natural-sort@0.1.0","dist":{"shasum":"e4c215b404bb452562d2b2ecff9495e9e7057ae9","size":2745,"noattachment":false,"key":"/natural-sort/-/natural-sort-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/natural-sort/download/natural-sort-0.1.0.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"tomekwi","email":"t.wiszniewski@gmail.com"},"maintainers":[{"name":"tomekwi","email":"t.wiszniewski@gmail.com"}],"directories":{},"publish_time":1416908927803,"_cnpm_publish_time":1416908927803,"_hasShrinkwrap":false}},"readme":"[![David – status of dependencies\n](https://img.shields.io/david/studio-b12/natural-sort.svg?style=flat-square)\n](https://david-dm.org/studio-b12/natural-sort)\n [![Code style: airbnb\n](https://img.shields.io/badge/code%20style-airbnb-777777.svg?style=flat-square)\n](https://github.com/airbnb/javascript)\n\n\n\n\nnatural-sort.js\n===============\n\n**Sorting with support for numbers, dates, unicode and more.**\n\n\n\n\n<div                                                               >&nbsp;</div>\n\nDefault features\n----------------\n\n- Numbers are handled properly (“2” is before “10”)\n- Dates are detected and sorted as well\n- Empty strings are after “z”\n\n\n\n\n<div                                                               >&nbsp;</div>\n\nUsage\n-----\n\n```js\n['10. tenth', 'odd', 1, '', '2. second'].sort(naturalSort())\n// [1, '2. second', '10. tenth', 'odd', '']\n\n[3, 4, 1, 5, 2].sort(naturalSort({direction: 'desc'}))\n// [5, 4, 3, 2, 1]\n\n['a', 'B'].sort(naturalSort())\n// ['a', 'B']\n['a', 'B'].sort(naturalSort({caseSensitive: true}))\n// ['B', 'a']\n```\n\n\n\n\n<div                                                               >&nbsp;</div>\n\nInstallation\n------------\n\n1. Download the script. You can use npm or bower:\n\n```\nnpm install natural-sort\n```\n\n```\nbower install natural-sort\n```\n\n2. Include the script before yours:\n\n```html\n<script src=\"/bower_components/natural-sort/dist/natural-sort.js\"></script>\n```\n\n\n\n\n<div                                                               >&nbsp;</div>\n\nCredits\n-------\n\nThe original version of this algorithm was published by Jim Palmer in [this blog post][].\n\n[this blog post]:  http://www.overset.com/2008/09/01/javascript-natural-sort-algorithm/  \"Javascript Natural Sort Algorithm With Unicode Support\"\n\n\n\n\n\n<div                                                               >&nbsp;</div>\n\nLicense\n-------\n\n[MIT][] © [Studio B12 GmbH][]\n\n[MIT]:              ./License.md\n[Studio B12 GmbH]:  http://studio-b12.de\n","_attachments":{},"homepage":"https://github.com/studio-b12/natural-sort#readme","bugs":{"url":"https://github.com/studio-b12/natural-sort/issues"},"license":"MIT"}