{"_id":"string-natural-compare","_rev":"303701","name":"string-natural-compare","description":"Compare alphanumeric strings the same way a human would, using a natural order algorithm","dist-tags":{"latest":"3.0.1"},"maintainers":[{"name":"nwoltman","email":"nwoltman@outlook.com"}],"time":{"modified":"2021-06-03T19:24:15.000Z","created":"2015-05-08T18:43:13.046Z","3.0.1":"2020-01-21T05:38:16.072Z","3.0.0":"2019-10-31T01:13:14.742Z","2.0.3":"2018-10-16T05:10:17.676Z","2.0.2":"2016-10-26T02:02:07.733Z","2.0.1":"2016-06-01T23:40:39.352Z","2.0.0":"2016-04-21T03:03:15.747Z","1.1.1":"2015-08-09T06:28:10.022Z","1.1.0":"2015-05-18T03:29:22.234Z","1.0.0":"2015-05-08T22:41:35.073Z","0.1.0":"2015-05-08T18:43:13.046Z"},"users":{"sbruchmann":true,"buster":true},"author":{"name":"Nathan Woltman","email":"nwoltman@outlook.com"},"repository":{"type":"git","url":"git+https://github.com/nwoltman/string-natural-compare.git"},"versions":{"3.0.1":{"name":"string-natural-compare","version":"3.0.1","description":"Compare alphanumeric strings the same way a human would, using a natural order algorithm","author":{"name":"Nathan Woltman","email":"nwoltman@outlook.com"},"license":"MIT","main":"natural-compare.js","repository":{"type":"git","url":"git+https://github.com/nwoltman/string-natural-compare.git"},"homepage":"https://github.com/nwoltman/string-natural-compare","bugs":{"url":"https://github.com/nwoltman/string-natural-compare/issues"},"keywords":["string","natural","compare","comparison","order","natcmp","strnatcmp","sort","natsort","alphanum","alphanumeric"],"eslintIgnore":["benchmark/node_modules/","coverage/"],"nyc":{"reporter":["html","text-summary"],"check-coverage":true,"branches":100,"lines":100,"statements":100},"devDependencies":{"@nwoltman/eslint-config":"^0.6.0","coveralls":"^3.0.9","eslint":"^6.8.0","mocha":"^7.0.0","nyc":"^15.0.0","should":"^13.2.3"},"scripts":{"lint":"eslint .","test":"eslint . && nyc mocha","coveralls":"nyc report --reporter=text-lcov | coveralls"},"gitHead":"a213a8e225d4a9c790db7661caf6a46b85c4b1c1","_id":"string-natural-compare@3.0.1","_nodeVersion":"13.6.0","_npmVersion":"6.13.4","dist":{"shasum":"7a42d58474454963759e8e8b7ae63d71c1e7fdf4","size":4100,"noattachment":false,"key":"/string-natural-compare/-/string-natural-compare-3.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-natural-compare/download/string-natural-compare-3.0.1.tgz"},"maintainers":[{"name":"nwoltman","email":"nwoltman@outlook.com"}],"_npmUser":{"name":"nwoltman","email":"nwoltman@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/string-natural-compare_3.0.1_1579585095963_0.8280695577883104"},"_hasShrinkwrap":false,"publish_time":1579585096072,"_cnpm_publish_time":1579585096072},"3.0.0":{"name":"string-natural-compare","version":"3.0.0","description":"Compare alphanumeric strings the same way a human would, using a natural order algorithm","author":{"name":"Nathan Woltman","email":"nwoltman@outlook.com"},"license":"MIT","main":"natural-compare.js","repository":{"type":"git","url":"git+https://github.com/nwoltman/string-natural-compare.git"},"homepage":"https://github.com/nwoltman/string-natural-compare","bugs":{"url":"https://github.com/nwoltman/string-natural-compare/issues"},"keywords":["string","natural","compare","comparison","order","natcmp","strnatcmp","sort","natsort","alphanum","alphanumeric"],"eslintIgnore":["benchmark/node_modules/","coverage/"],"nyc":{"reporter":["html","text-summary"],"check-coverage":true,"branches":100,"lines":100,"statements":100},"devDependencies":{"@nwoltman/eslint-config":"^0.5.0","coveralls":"^3.0.7","eslint":"^6.6.0","mocha":"^6.2.2","nyc":"^14.1.1","should":"^13.2.3"},"scripts":{"lint":"eslint .","test":"eslint . && nyc mocha","coveralls":"nyc report --reporter=text-lcov | coveralls"},"gitHead":"3e0a51624ed49f2a4069e8fb13f9052a2165707d","_id":"string-natural-compare@3.0.0","_nodeVersion":"13.0.1","_npmVersion":"6.12.0","dist":{"shasum":"63168425adb16d67f93e2a827dfae4c8749de424","size":3985,"noattachment":false,"key":"/string-natural-compare/-/string-natural-compare-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-natural-compare/download/string-natural-compare-3.0.0.tgz"},"maintainers":[{"name":"nwoltman","email":"nwoltman@outlook.com"}],"_npmUser":{"name":"nwoltman","email":"nwoltman@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/string-natural-compare_3.0.0_1572484394551_0.5541586658944038"},"_hasShrinkwrap":false,"publish_time":1572484394742,"_cnpm_publish_time":1572484394742},"2.0.3":{"name":"string-natural-compare","version":"2.0.3","description":"Compare alphanumeric strings the same way a human would, using a natural order algorithm","author":{"name":"Nathan Woltman","email":"nwoltman@outlook.com"},"license":"MIT","main":"natural-compare.js","repository":{"type":"git","url":"git+https://github.com/nwoltman/string-natural-compare.git"},"bugs":{"url":"https://github.com/nwoltman/string-natural-compare/issues"},"homepage":"https://github.com/nwoltman/string-natural-compare","devDependencies":{"coveralls":"^3.0.2","grunt":"~1.0.3","grunt-eslint":"^21.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-mocha-test":"^0.13.3","istanbul":"^0.4.5","jit-grunt":"^0.10.0","mocha":"^5.2.0","should":"^13.2.1"},"scripts":{"test":"grunt"},"keywords":["string","natural","compare","comparison","order","natcmp","strnatcmp","sort","natsort","alphanum","alphanumeric"],"gitHead":"2f70d49a9f1b60a7bc03c1a0c2755aac854f814d","_id":"string-natural-compare@2.0.3","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"nwoltman","email":"nwoltman@outlook.com"},"dist":{"shasum":"9dbe1dd65490a5fe14f7a5c9bc686fc67cb9c6e4","size":3815,"noattachment":false,"key":"/string-natural-compare/-/string-natural-compare-2.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-natural-compare/download/string-natural-compare-2.0.3.tgz"},"maintainers":[{"name":"nwoltman","email":"nwoltman@outlook.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/string-natural-compare_2.0.3_1539666617563_0.9101370367945449"},"_hasShrinkwrap":false,"publish_time":1539666617676,"_cnpm_publish_time":1539666617676},"2.0.2":{"name":"string-natural-compare","version":"2.0.2","description":"Compare alphanumeric strings the same way a human would, using a natural order algorithm","author":{"name":"Nathan Woltman","email":"nwoltman@outlook.com"},"license":"MIT","main":"natural-compare.js","files":["natural-compare.js","LICENSE.txt"],"repository":{"type":"git","url":"git+https://github.com/nwoltman/string-natural-compare.git"},"bugs":{"url":"https://github.com/nwoltman/string-natural-compare/issues"},"homepage":"https://github.com/nwoltman/string-natural-compare","devDependencies":{"coveralls":"^2.11.9","grunt":"~1.0.1","grunt-eslint":"^19.0.0","grunt-mocha-istanbul":"^5.0.1","grunt-mocha-test":"^0.13.2","istanbul":"^0.4.3","jit-grunt":"^0.10.0","mocha":"^3.1.2","should":"^11.1.1"},"scripts":{"test":"grunt"},"keywords":["string","natural","compare","comparison","order","natcmp","strnatcmp","sort","natsort","alphanum","alphanumeric"],"gitHead":"567fcd0120135e10da17825f124ac22e34d6e995","_id":"string-natural-compare@2.0.2","_shasum":"c5ce4e278ab5d1265ae6fc55435aeb7b76fcb001","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.6.1","_npmUser":{"name":"nwoltman","email":"nwoltman@outlook.com"},"dist":{"shasum":"c5ce4e278ab5d1265ae6fc55435aeb7b76fcb001","size":3735,"noattachment":false,"key":"/string-natural-compare/-/string-natural-compare-2.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-natural-compare/download/string-natural-compare-2.0.2.tgz"},"maintainers":[{"name":"nwoltman","email":"nwoltman@outlook.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/string-natural-compare-2.0.2.tgz_1477447326074_0.4904531214851886"},"directories":{},"publish_time":1477447327733,"_cnpm_publish_time":1477447327733,"_hasShrinkwrap":false},"2.0.1":{"name":"string-natural-compare","version":"2.0.1","description":"Compare alphanumeric strings the same way a human would, using a natural order algorithm","author":{"name":"Nathan Woltman","email":"nwoltman@outlook.com"},"license":"MIT","main":"natural-compare.js","files":["natural-compare.js","LICENSE.txt"],"repository":{"type":"git","url":"git+https://github.com/nwoltman/string-natural-compare.git"},"bugs":{"url":"https://github.com/nwoltman/string-natural-compare/issues"},"homepage":"https://github.com/nwoltman/string-natural-compare","devDependencies":{"coveralls":"^2.11.9","grunt":"~1.0.1","grunt-eslint":"^18.0.0","grunt-mocha-istanbul":"^5.0.1","grunt-mocha-test":"^0.12.7","istanbul":"^0.4.3","jit-grunt":"^0.10.0","mocha":"^2.3.2","should":"^9.0.0"},"scripts":{"test":"grunt"},"keywords":["string","natural","compare","comparison","order","natcmp","strnatcmp","sort","natsort","alphanum","alphanumeric"],"gitHead":"acb745660d10d1212d7157f268363b2f59796cd6","_id":"string-natural-compare@2.0.1","_shasum":"22a654f928940951879fabb76ac27fadccf969da","_from":".","_npmVersion":"2.15.1","_nodeVersion":"0.12.14","_npmUser":{"name":"nwoltman","email":"nwoltman@outlook.com"},"dist":{"shasum":"22a654f928940951879fabb76ac27fadccf969da","size":4103,"noattachment":false,"key":"/string-natural-compare/-/string-natural-compare-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-natural-compare/download/string-natural-compare-2.0.1.tgz"},"maintainers":[{"name":"nwoltman","email":"nwoltman@outlook.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/string-natural-compare-2.0.1.tgz_1464824438193_0.5553042341489345"},"directories":{},"publish_time":1464824439352,"_cnpm_publish_time":1464824439352,"_hasShrinkwrap":false},"2.0.0":{"name":"string-natural-compare","version":"2.0.0","description":"Compare alphanumeric strings the same way a human would, using a natural order algorithm","author":{"name":"Nathan Woltman","email":"nwoltman@outlook.com"},"license":"MIT","main":"natural-compare.js","files":["natural-compare.js","LICENSE.txt"],"repository":{"type":"git","url":"git+https://github.com/nwoltman/string-natural-compare.git"},"bugs":{"url":"https://github.com/nwoltman/string-natural-compare/issues"},"homepage":"https://github.com/nwoltman/string-natural-compare","devDependencies":{"coveralls":"^2.11.9","grunt":"~1.0.1","grunt-eslint":"^18.0.0","grunt-mocha-istanbul":"^4.0.2","grunt-mocha-test":"^0.12.7","istanbul":"^0.4.3","jit-grunt":"^0.10.0","mocha":"^2.3.2","should":"^8.0.2"},"scripts":{"test":"grunt"},"keywords":["string","natural","compare","comparison","order","natcmp","strnatcmp","sort","natsort","alphanum","alphanumeric"],"gitHead":"3aea25f05620516b1f19e5e448501d690328497a","_id":"string-natural-compare@2.0.0","_shasum":"846b6aa6316a5accf4b475acaa331c6298b1aef5","_from":".","_npmVersion":"3.8.3","_nodeVersion":"5.10.1","_npmUser":{"name":"nwoltman","email":"nwoltman@outlook.com"},"dist":{"shasum":"846b6aa6316a5accf4b475acaa331c6298b1aef5","size":4114,"noattachment":false,"key":"/string-natural-compare/-/string-natural-compare-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-natural-compare/download/string-natural-compare-2.0.0.tgz"},"maintainers":[{"name":"nwoltman","email":"nwoltman@outlook.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/string-natural-compare-2.0.0.tgz_1461207794391_0.4810239088255912"},"directories":{},"publish_time":1461207795747,"_cnpm_publish_time":1461207795747,"_hasShrinkwrap":false},"1.1.1":{"name":"string-natural-compare","version":"1.1.1","description":"Compare alphanumeric strings the same way a human would, using a natural order algorithm","main":"natural-compare.js","scripts":{"test":"grunt"},"repository":{"type":"git","url":"git+https://github.com/woollybogger/string-natural-compare.git"},"keywords":["string","natural","compare","comparison","order","natcmp","natcomp","strnatcmp","strnatcomp","sort","natsort","alphanum","alphanumeric"],"author":{"name":"Nathan Woltman","email":"nwoltman@outlook.com"},"license":"MIT","bugs":{"url":"https://github.com/woollybogger/string-natural-compare/issues"},"homepage":"https://github.com/woollybogger/string-natural-compare","config":{"blanket":{"pattern":["string-natural-compare/natural-compare.js"]}},"devDependencies":{"grunt":"~0.4.5","grunt-contrib-copy":"^0.8.0","grunt-contrib-jshint":"^0.11.2","grunt-contrib-uglify":"0.9.1","grunt-jscs":"~2.0.0","grunt-jsonlint":"^1.0.4","grunt-mocha-cov":"~0.4.0","mocha":"^2.2.5","should":"^7.0.2"},"gitHead":"920e0b4a8467e19d0d25bf5be6c9ed2e251e7558","_id":"string-natural-compare@1.1.1","_shasum":"3aad2ab074637e8bf419a6e9c0bb77147b9b9380","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"woollybogger","email":"nwoltman@outlook.com"},"dist":{"shasum":"3aad2ab074637e8bf419a6e9c0bb77147b9b9380","size":2180,"noattachment":false,"key":"/string-natural-compare/-/string-natural-compare-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-natural-compare/download/string-natural-compare-1.1.1.tgz"},"maintainers":[{"name":"nwoltman","email":"nwoltman@outlook.com"}],"directories":{},"publish_time":1439101690022,"_cnpm_publish_time":1439101690022,"deprecated":"v1 has been deprecated. Please follow this guide to migrate to v2 or higher: https://github.com/nwoltman/string-natural-compare/tree/v2.0.0#migration-guide","_hasShrinkwrap":false},"1.1.0":{"name":"string-natural-compare","version":"1.1.0","description":"Compare alphanumeric strings the same way a human would, using a natural order algorithm","main":"index.js","scripts":{"test":"grunt"},"repository":{"type":"git","url":"git+https://github.com/woollybogger/string-natural-compare.git"},"keywords":["string","natural","compare","comparison","order","natcmp","natcomp","strnatcmp","strnatcomp","sort","natsort","alphanum","alphanumeric"],"author":{"name":"Nathan Woltman","email":"nwoltman@outlook.com"},"license":"MIT","bugs":{"url":"https://github.com/woollybogger/string-natural-compare/issues"},"homepage":"https://github.com/woollybogger/string-natural-compare","config":{"blanket":{"pattern":["string-natural-compare/index.js"]}},"devDependencies":{"grunt":"~0.4.5","grunt-contrib-copy":"^0.8.0","grunt-contrib-jshint":"^0.11.2","grunt-contrib-uglify":"0.9.1","grunt-jscs":"~1.8.0","grunt-jsdoc-to-markdown":"~1.1.0","grunt-jsonlint":"^1.0.4","grunt-mocha-cov":"~0.4.0","mocha":"^2.2.5","should":"^6.0.1"},"gitHead":"4c1fbd652bce5e98462c2c7184b4384a7d073de2","_id":"string-natural-compare@1.1.0","_shasum":"cbd3e5480bc2ba24c6fe0109da8e4065cdb1a11c","_from":".","_npmVersion":"2.9.1","_nodeVersion":"0.12.3","_npmUser":{"name":"woollybogger","email":"nwoltman@outlook.com"},"maintainers":[{"name":"nwoltman","email":"nwoltman@outlook.com"}],"dist":{"shasum":"cbd3e5480bc2ba24c6fe0109da8e4065cdb1a11c","size":4164,"noattachment":false,"key":"/string-natural-compare/-/string-natural-compare-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-natural-compare/download/string-natural-compare-1.1.0.tgz"},"directories":{},"publish_time":1431919762234,"_cnpm_publish_time":1431919762234,"deprecated":"v1 has been deprecated. Please follow this guide to migrate to v2 or higher: https://github.com/nwoltman/string-natural-compare/tree/v2.0.0#migration-guide","_hasShrinkwrap":false},"1.0.0":{"name":"string-natural-compare","version":"1.0.0","description":"Compare alphanumeric strings the same way a human would, using a natural order algorithm","main":"index.js","scripts":{"test":"grunt"},"repository":{"type":"git","url":"https://github.com/woollybogger/string-natural-compare"},"keywords":["string","natural","compare","comparison","order","natcmp","natcomp","strnatcmp","strnatcomp","sort","natsort","alphanum","alphanumeric"],"author":{"name":"Nathan Woltman","email":"nwoltman@outlook.com"},"license":"MIT","bugs":{"url":"https://github.com/woollybogger/string-natural-compare/issues"},"homepage":"https://github.com/woollybogger/string-natural-compare","config":{"blanket":{"pattern":["string-natural-compare/index.js"]}},"devDependencies":{"grunt":"~0.4.5","grunt-contrib-copy":"^0.8.0","grunt-contrib-jshint":"^0.11.2","grunt-contrib-uglify":"0.9.1","grunt-jscs":"~1.8.0","grunt-jsdoc-to-markdown":"~1.1.0","grunt-jsonlint":"^1.0.4","grunt-mocha-cov":"~0.4.0","mocha":"^2.2.4","should":"^6.0.1"},"gitHead":"ec4bb304ce4d4af1d25c83554b9f915180d31e86","_id":"string-natural-compare@1.0.0","_shasum":"6510708bf538bff7ccebe78d7d90ef3504fb40f3","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.12.2","_npmUser":{"name":"woollybogger","email":"nwoltman@outlook.com"},"maintainers":[{"name":"nwoltman","email":"nwoltman@outlook.com"}],"dist":{"shasum":"6510708bf538bff7ccebe78d7d90ef3504fb40f3","size":4086,"noattachment":false,"key":"/string-natural-compare/-/string-natural-compare-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-natural-compare/download/string-natural-compare-1.0.0.tgz"},"directories":{},"publish_time":1431124895073,"_cnpm_publish_time":1431124895073,"deprecated":"v1 has been deprecated. Please follow this guide to migrate to v2 or higher: https://github.com/nwoltman/string-natural-compare/tree/v2.0.0#migration-guide","_hasShrinkwrap":false},"0.1.0":{"name":"string-natural-compare","version":"0.1.0","description":"Compare alphanumeric strings the same way a human would, using a natural order algorithm","main":"index.js","scripts":{"test":"grunt"},"repository":{"type":"git","url":"https://github.com/woollybogger/string-natural-compare"},"keywords":["string","natural","compare","comparison","order","natcmp","natcomp","strnatcmp","strnatcomp","sort","natsort","alphanum","alphanumeric"],"author":{"name":"Nathan Woltman","email":"nwoltman@outlook.com"},"license":"MIT","bugs":{"url":"https://github.com/woollybogger/string-natural-compare/issues"},"homepage":"https://github.com/woollybogger/string-natural-compare","config":{"blanket":{"pattern":["string-natural-compare/index.js"]}},"devDependencies":{"grunt":"~0.4.5","grunt-contrib-copy":"^0.8.0","grunt-contrib-jshint":"^0.11.2","grunt-contrib-uglify":"0.9.1","grunt-jscs":"~1.8.0","grunt-jsdoc-to-markdown":"~1.1.0","grunt-jsonlint":"^1.0.4","grunt-mocha-cov":"~0.4.0","mocha":"^2.2.4","should":"^6.0.1"},"gitHead":"da841fa0eeb87de9707cf0e0fc17711edb2dd987","_id":"string-natural-compare@0.1.0","_shasum":"3cdf932f330b1de20e14823723aed8729d629b4b","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.12.2","_npmUser":{"name":"woollybogger","email":"nwoltman@outlook.com"},"maintainers":[{"name":"nwoltman","email":"nwoltman@outlook.com"}],"dist":{"shasum":"3cdf932f330b1de20e14823723aed8729d629b4b","size":3615,"noattachment":false,"key":"/string-natural-compare/-/string-natural-compare-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/string-natural-compare/download/string-natural-compare-0.1.0.tgz"},"directories":{},"publish_time":1431110593046,"_cnpm_publish_time":1431110593046,"deprecated":"v1 has been deprecated. Please follow this guide to migrate to v2 or higher: https://github.com/nwoltman/string-natural-compare/tree/v2.0.0#migration-guide","_hasShrinkwrap":false}},"readme":"# String Natural Compare\n\n[![NPM Version](https://img.shields.io/npm/v/string-natural-compare.svg)](https://www.npmjs.com/package/string-natural-compare)\n[![Build Status](https://travis-ci.org/nwoltman/string-natural-compare.svg?branch=master)](https://travis-ci.org/nwoltman/string-natural-compare)\n[![Coverage Status](https://coveralls.io/repos/nwoltman/string-natural-compare/badge.svg?branch=master)](https://coveralls.io/r/nwoltman/string-natural-compare?branch=master)\n[![Dependencies Status](https://img.shields.io/david/nwoltman/string-natural-compare)](https://david-dm.org/nwoltman/string-natural-compare)\n\nCompare alphanumeric strings the same way a human would, using a natural order algorithm (originally known as the [alphanum algorithm](http://davekoelle.com/alphanum.html)) where numeric characters are sorted based on their numeric values rather than their ASCII values.\n\n```\nStandard sorting:   Natural order sorting:\n    img1.png            img1.png\n    img10.png           img2.png\n    img12.png           img10.png\n    img2.png            img12.png\n```\n\nThis module exports a function that returns a number indicating whether one string should come before, after, or is the same as another string.\nIt can be used directly with the native [`.sort()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) array method.\n\n### Fast and Robust\n\nThis module can compare strings containing any size of number and is heavily tested with a custom [benchmark suite](https://github.com/nwoltman/string-natural-compare/tree/master/benchmark) to make sure that it is as fast as possible.\n\n\n## Installation\n\n```sh\nnpm install string-natural-compare --save\n# or\nyarn add string-natural-compare\n```\n\n\n## Usage\n\n#### `naturalCompare(strA, strB[, options])`\n\n+ `strA` (_string_)\n+ `strB` (_string_)\n+ `options` (_object_) - Optional options object with the following options:\n  + `caseInsensitive` (_boolean_) - Set to `true` to compare strings case-insensitively. Default: `false`.\n  + `alphabet` (_string_) - A string of characters that define a custom character ordering. Default: `undefined`.\n\n```js\nconst naturalCompare = require('string-natural-compare');\n\n// Simple, case-sensitive sorting\nconst files = ['z1.doc', 'z10.doc', 'z17.doc', 'z2.doc', 'z23.doc', 'z3.doc'];\nfiles.sort(naturalCompare);\n// -> ['z1.doc', 'z2.doc', 'z3.doc', 'z10.doc', 'z17.doc', 'z23.doc']\n\n\n// Case-insensitive sorting\nconst chars = ['B', 'C', 'a', 'd'];\nconst naturalCompareCI = (a, b) => naturalCompare(a, b, {caseInsensitive: true});\nchars.sort(naturalCompareCI);\n// -> ['a', 'B', 'C', 'd']\n\n// Note:\n['a', 'A'].sort(naturalCompareCI); // -> ['a', 'A']\n['A', 'a'].sort(naturalCompareCI); // -> ['A', 'a']\n\n\n// Compare strings containing large numbers\nnaturalCompare(\n  '1165874568735487968325787328996865',\n  '265812277985321589735871687040841'\n);\n// -> 1\n// (Other inputs with the same ordering as this example may yield a different number > 0)\n\n\n// Sorting an array of objects\nconst hotelRooms = [\n  {street: '350 5th Ave', room: 'A-1021'},\n  {street: '350 5th Ave', room: 'A-21046-b'}\n];\n// Sort by street (case-insensitive), then by room (case-sensitive)\nhotelRooms.sort((a, b) => (\n  naturalCompare(a.street, b.street, {caseInsensitive: true}) ||\n  naturalCompare(a.room, b.room)\n));\n\n\n// When text transformation is needed or when doing a case-insensitive sort on a\n// large array of objects, it is best for performance to pre-compute the\n// transformed text and store it on the object. This way, the text will not need\n// to be transformed for every comparison while sorting.\nconst cars = [\n  {make: 'Audi', model: 'R8'},\n  {make: 'Porsche', model: '911 Turbo S'}\n];\n// Sort by make, then by model (both case-insensitive)\nfor (const car of cars) {\n  car.sortKey = (car.make + ' ' + car.model).toLowerCase();\n}\ncars.sort((a, b) => naturalCompare(a.sortKey, b.sortKey));\n\n\n// Using a custom alphabet (Russian alphabet)\nconst russianOpts = {\n  alphabet: 'АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюя',\n};\n['Ё', 'А', 'б', 'Б'].sort((a, b) => naturalCompare(a, b, russianOpts));\n// -> ['А', 'Б', 'Ё', 'б']\n```\n\n**Note:** Putting numbers in the custom alphabet can cause undefined behaviour.\n","_attachments":{},"homepage":"https://github.com/nwoltman/string-natural-compare","bugs":{"url":"https://github.com/nwoltman/string-natural-compare/issues"},"license":"MIT"}