{"_id":"compare","_rev":"9-ac63a7afdce0f9ac31a6f39b861f13a9","name":"compare","description":"Compare primitives the right way (using `<`, `>` and `==`)","dist-tags":{"latest":"2.0.0"},"versions":{"0.0.1":{"name":"compare","version":"0.0.1","description":"ERROR: No README.md file found!","main":"index.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/hughsk/compare.git"},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://hughskennedy.com/"},"license":"MIT","keywords":["compare","all","elements","array","comparison"],"devDependencies":{"tape":"~1.0.4"},"readme":"# compare #\n\nCompare each element in an array with every other element in the array.\n\n## Installation ##\n\n``` bash\nnpm install compare\n```\n\n## Usage ##\n\n``` javascript\nvar compare = require('compare')\n\ncompare([1, 1, 1, 1], function(a, b) { return a === b }) // true\ncompare([1, 2, 3, 4], function(a, b) { return a !== b }) // true\ncompare([1, 2, 3, 3], function(a, b) { return a !== b }) // false\n```\n","readmeFilename":"README.md","_id":"compare@0.0.1","dist":{"shasum":"610dd337e7d893a22e4f6a7d7869d9391f2be081","tarball":"https://registry.npmjs.org/compare/-/compare-0.0.1.tgz","integrity":"sha512-1DZC5yvYJdgWzl/OpzqTk2XsjWrxBk+9NmKxo68fRXTyuxxLdP0x2wErlUN6+Gj1o/T0d7ybqczm3hCa69s1vg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2wwVzGPR1hE8Ly9+AbjmBXQbLnE/KPEhcfnEj2OHYqwIgfRAbOe3k+53IQQxs7ZTjJYRnpvbaxvNOw3VCWCf7xDw="}]},"_npmVersion":"1.1.71","_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}],"directories":{}},"2.0.0":{"name":"compare","version":"2.0.0","description":"Compare primitives the right way (using `<`, `>` and `==`)","main":"index.js","dependencies":{},"devDependencies":{},"scripts":{},"repository":{"type":"git","url":"git+https://github.com/emilbayes/compare.git"},"keywords":["compare","cmpstr","string","number","numeric","sort","stable","ascii"],"author":{"name":"Emil Bay","email":"github@tixz.dk"},"license":"ISC","bugs":{"url":"https://github.com/emilbayes/compare/issues"},"homepage":"https://github.com/emilbayes/compare#readme","gitHead":"637cd2c81a46b6a99641be5b3679cc337f1bb866","_id":"compare@2.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"emilbayes","email":"github@tixz.dk"},"dist":{"integrity":"sha512-FXeLLVm09Uh7Updmmx2NCCRG2nMq+mdY3DR9PqhVeOrie3IFU+occFQoqziFkHlTUDw8mDgmdblIZ+J9tsSAUA==","shasum":"8090b34dcb288f629e905972da69ea7a6d5922a0","tarball":"https://registry.npmjs.org/compare/-/compare-2.0.0.tgz","fileCount":4,"unpackedSize":2682,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa9cvnCRA9TVsSAnZWagAA7YQP/RK1GrWdSdtLSkBhZ/4D\n0LB3A8LES8my7RcoeQNwYGnx3gx4wk2F6jvzILV/DGAiAc7CgLuLaFly2ADG\nhmkf9tNq33LLJByScthIEBODbQ9A3C/CU2IcV5JyJqqRlAtlPEb3DqDAtzEQ\nvxnc1zlYh1rYH2Rim2I0PuU28AzQjf4YXSgj6727ou2riNjWtfDb5zZWJdNW\nLhhwP2tnw/VV/g9cU/+/Gj8xXtXitwCkc47kGeloFDVD9BAH/Muq1YNjtx+Y\nzOJPeXMuPaqAn2s0tx6cpsgdPCyJHOb8NjTVo7bSIfS/2Jq1w0RunaaLLNye\nxAeyltExFgSMo1AkSsn/u7V4MvRnk8S6Q+6AG7mksE1T8pqxbNilEokHRM7c\nTGTa308xLHy/mH0qp7YQkfs/Bz/TbDWBuoJ2YpqAdwHGRL2AZmvQ2+RBPcIb\n03GqIWORQPAUkYJEw0EZ1RxCkcr77NAPOTtR/dOnR7YJeckGVz8snTQHplaR\np4S73DTRJRUV3aDIGxV7isaRC/RIYOMtJ/6PFtzFfW6oD9DsIhe/iyJb1m7a\nYpbM3RttSmAvKUCZwYi9hFFyrjN9pIBa5lFpSLrLEDXYL9XVAZp5a2PMZpNV\n8RY/txQc6kdEsKBeTYGCqr6tNkmjGZ+b3uBUe3dIDI9YhwpJks+IGpy4NRmY\nziXT\r\n=WRpx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9Yx+SBm1XSN3CmC968TFrYHSrw8wrnkBLLZH3Vr6fmQIgcNcquL5y983Myndnvz4LBUbFRQhLQUDMsdXkkt8CnRI="}]},"maintainers":[{"email":"github@tixz.dk","name":"emilbayes"},{"email":"hughskennedy@gmail.com","name":"hughsk"},{"email":"mathiasbuus@gmail.com","name":"mafintosh"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/compare_2.0.0_1526057958532_0.5564342051272659"},"_hasShrinkwrap":false}},"readme":"# `compare`\n\n![100-correct](https://img.shields.io/badge/Correct%20-100%25-brightgreen.svg?style=flat)\n\n> Compare primitives the right way (using `<`, `>` and `==`)\n\nThis module does the right thing with numbers and ascii strings.\nNormally `String.prototype.localeCompare` is recommended for strings,\nbut that can have nasty side effects on some machines, eg.\n\n```js\n'cu'.localeCompare('cs', 'hu')\n```\n\nCompare the above in stock node (which doesn't come with `Intl`) and\na browser of your choice (which most likely has `Intl` support).\n\n## Usage\n\n```js\nvar compare = require('compare')\n[1, 2, 10].sort() // [1, 10, 2]\n[1, 2, 10].sort(compare) // [1, 2, 10]\n\n// Below is sorted correctly according to Hungarian, but runtimes without Intl\n// support will reorder them\n['cu', 'cs'].sort((a, b) => a.localeCompare(b, 'hu'))\n['cu', 'cs'].sort(compare) // This will always sort the same\n```\n\n## API\n\n### `compare(a, b)`\n\nStandard `Array.prototype.sort(cmp)` function signature. If `a > b` return `1`,\nif `a < b` return `-1`, otherwise return `0`\n\n## Credit\n\nThanks to [`hughsk`](https://github.com/hughsk) for the npm name!\n\n## Install\n\n```sh\nnpm install compare\n```\n\n## License\n\n[ISC](LICENSE)\n","maintainers":[{"email":"github@tixz.dk","name":"emilbayes"},{"email":"hughskennedy@gmail.com","name":"hughsk"},{"email":"mathiasbuus@gmail.com","name":"mafintosh"}],"time":{"modified":"2022-06-13T19:39:49.156Z","created":"2013-06-17T02:46:28.304Z","0.0.1":"2013-06-17T02:46:31.719Z","2.0.0":"2018-05-11T16:59:18.710Z"},"author":{"name":"Emil Bay","email":"github@tixz.dk"},"repository":{"type":"git","url":"git+https://github.com/emilbayes/compare.git"},"homepage":"https://github.com/emilbayes/compare#readme","keywords":["compare","cmpstr","string","number","numeric","sort","stable","ascii"],"bugs":{"url":"https://github.com/emilbayes/compare/issues"},"license":"ISC","readmeFilename":"README.md"}