{"_id":"anysort","_rev":"21-91fdfc99675771fca19d9d2f3d468bed","name":"anysort","description":"Sorting and matching utility using configurable string, glob, regular expression, and/or function matchers","dist-tags":{"latest":"2.0.0"},"versions":{"0.1.0":{"name":"anysort","version":"0.1.0","description":"Sorting and matching utility using configurable string, glob, regular expression, and/or function matchers","author":{"name":"Elan Shanker","url":"http://github.com/es128"},"homepage":"https://github.com/es128/anysort","repository":{"type":"git","url":"git@github.com:es128/anysort.git"},"bugs":{"url":"https://github.com/es128/anysort/issues"},"main":"lib","keywords":["sort","array","match","any","string","file","fs","list","glob","regex","regexp","regular","expression","function"],"dependencies":{"anymatch":"~0.1.1"},"scripts":{"prepublish":"rm -rf lib && coffee --bare --output lib/ src/"},"_id":"anysort@0.1.0","dist":{"shasum":"6fa6571f7a3a07a6df16394f9cb4c3d096e5b2c4","tarball":"https://registry.npmjs.org/anysort/-/anysort-0.1.0.tgz","integrity":"sha512-Xmy9nMYzaWbuK/SgpGeHi2Tc4qFTH7QtRPb/z1i4ua8g2Tq+Bpz/rSFft40s5drRZlRppq0rvlf1pC6UAnPMzw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFUj7Qic/XUEZg1G2HgjhyVgpexuIs8arWt7EicUAHxJAiBTFh133lG/KwQoinDLUOJkT0lMeYuLpY7SSX7VVHrBXQ=="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"es128","email":"elan.shanker+npm@gmail.com"},"maintainers":[{"name":"es128","email":"elan.shanker+npm@gmail.com"}],"directories":{}},"0.1.1":{"name":"anysort","version":"0.1.1","description":"Sorting and matching utility using configurable string, glob, regular expression, and/or function matchers","author":{"name":"Elan Shanker","url":"http://github.com/es128"},"homepage":"https://github.com/es128/anysort","repository":{"type":"git","url":"git@github.com:es128/anysort.git"},"bugs":{"url":"https://github.com/es128/anysort/issues"},"main":"lib","keywords":["sort","array","match","any","string","file","fs","list","glob","regex","regexp","regular","expression","function"],"dependencies":{"anymatch":"~0.1.1"},"scripts":{"prepublish":"rm -rf lib && coffee --bare --output lib/ src/"},"_id":"anysort@0.1.1","dist":{"shasum":"e8cee7dd156a488aeb4a0bad457baeea49b237b3","tarball":"https://registry.npmjs.org/anysort/-/anysort-0.1.1.tgz","integrity":"sha512-kT+NRsRS+kMrMWEys8ssOjBGdZ3P+NkrQW9H+lPNF+y2VlfwBxkvT3OC1sTPdEVmU0YVauEzS9GklhrAF5RoaQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCr/P++TPBG/CRo6HCeOQp3u0sNshudoJPvPTDWFkgeRwIhAK/1nkLitvaBHGhHdshvsQ8gJQkC3qJ7boix+Syya7Tc"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"es128","email":"elan.shanker+npm@gmail.com"},"maintainers":[{"name":"es128","email":"elan.shanker+npm@gmail.com"}],"directories":{}},"0.1.2":{"name":"anysort","version":"0.1.2","description":"Sorting and matching utility using configurable string, glob, regular expression, and/or function matchers","author":{"name":"Elan Shanker","url":"http://github.com/es128"},"homepage":"https://github.com/es128/anysort","repository":{"type":"git","url":"git@github.com:es128/anysort.git"},"bugs":{"url":"https://github.com/es128/anysort/issues"},"main":"lib","keywords":["sort","array","match","any","string","file","fs","list","glob","regex","regexp","regular","expression","function"],"dependencies":{"anymatch":"~0.1.1"},"scripts":{"prepublish":"rm -rf lib && coffee --bare --output lib/ src/"},"_id":"anysort@0.1.2","dist":{"shasum":"a7c5287114e3eee351f41e5d362093534bfc6d7b","tarball":"https://registry.npmjs.org/anysort/-/anysort-0.1.2.tgz","integrity":"sha512-k/v8KWGg8v9tmbHSZvrFSHHo3GP28d/oDjYEpRoJt3Z8ztgz7J0dVx5K0CSD9/KBYMaxZ6U8mhni2FZmXJhKuw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG1Fl1LOOI8leQFDF8kl96xR8HiJL1mAALbPnv8AnkFEAiEA2K41FEzsZl174IxV9Mn/c6iUP8Ao1taKjhDzYadd/G4="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"es128","email":"elan.shanker+npm@gmail.com"},"maintainers":[{"name":"es128","email":"elan.shanker+npm@gmail.com"}],"directories":{}},"0.1.3":{"name":"anysort","version":"0.1.3","description":"Sorting and matching utility using configurable string, glob, regular expression, and/or function matchers","author":{"name":"Elan Shanker","url":"http://github.com/es128"},"homepage":"https://github.com/es128/anysort","repository":{"type":"git","url":"git@github.com:es128/anysort.git"},"bugs":{"url":"https://github.com/es128/anysort/issues"},"main":"lib","keywords":["sort","array","match","any","string","file","fs","list","glob","regex","regexp","regular","expression","function"],"dependencies":{"anymatch":"~0.1.1"},"scripts":{"prepublish":"rm -rf lib && coffee --bare --output lib/ src/"},"_id":"anysort@0.1.3","dist":{"shasum":"7b5bf2e4bc3e8060e112d51cdf501e1e896e6dbe","tarball":"https://registry.npmjs.org/anysort/-/anysort-0.1.3.tgz","integrity":"sha512-Id5zKbZa3NhGsa/2Mx5Q9A8NwJ/GdGkheVM3YxY7pEkBGgGVtCm/ngV85QW/T4ZgnRyTTro300v3++MbeSJELw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbKjwdNdxx3aHtdBRB13d8ywHbLou2mzBjV1PDvbaYmQIgPsNoFmqUMYLvKTHcdRR9McCmHO5SmLtsjnjE99H9PNk="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"es128","email":"elan.shanker+npm@gmail.com"},"maintainers":[{"name":"es128","email":"elan.shanker+npm@gmail.com"}],"directories":{}},"0.2.0":{"name":"anysort","version":"0.2.0","description":"Sorting and matching utility using configurable string, glob, regular expression, and/or function matchers","author":{"name":"Elan Shanker","url":"http://github.com/es128"},"homepage":"https://github.com/es128/anysort","repository":{"type":"git","url":"git@github.com:es128/anysort.git"},"bugs":{"url":"https://github.com/es128/anysort/issues"},"main":"lib","keywords":["sort","array","match","any","string","file","fs","list","glob","regex","regexp","regular","expression","function"],"dependencies":{"anymatch":"~0.2.0"},"scripts":{"prepublish":"rm -rf lib && coffee --bare --output lib/ src/","test":"rm -rf lib && coffee --bare --output lib/ src/ && istanbul test _mocha -- test/test.* --compilers coffee:coffee-script/register"},"license":"MIT","devDependencies":{"coffee-script":"~1.7.1","mocha":"~1.17.1","istanbul":"~0.2.4"},"_id":"anysort@0.2.0","dist":{"shasum":"57d7035a84960566763568fc5e2d9ab4b047fe60","tarball":"https://registry.npmjs.org/anysort/-/anysort-0.2.0.tgz","integrity":"sha512-Hky4ZrMIQvfPSqlIVVwP+P9T04wGzxFHqYqTg4SPuquzvH1FhfDbo0fORyOXmdbtCehwh36GLkipqA4uuP0kyA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0brbz1zss7JdUWnZWyRh/Dz3j9FWD6fKNeqwH5RNkGwIhALth6q8ymltsOdz8HBRacb/l/khzl2i59j/DDglhVzSu"}]},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"es128","email":"elan.shanker+npm@gmail.com"},"maintainers":[{"name":"es128","email":"elan.shanker+npm@gmail.com"}],"directories":{}},"1.0.0":{"name":"anysort","version":"1.0.0","description":"Sorting and matching utility using configurable string, glob, regular expression, and/or function matchers","files":["index.js"],"author":{"name":"Elan Shanker","url":"http://github.com/es128"},"homepage":"https://github.com/es128/anysort","repository":{"type":"git","url":"https://github.com/es128/anysort"},"bugs":{"url":"https://github.com/es128/anysort/issues"},"keywords":["sort","array","match","any","string","file","fs","list","glob","regex","regexp","regular","expression","function"],"dependencies":{"anymatch":"~1.0.0"},"scripts":{"test":"istanbul cover _mocha && cat ./coverage/lcov.info | coveralls"},"license":"ISC","devDependencies":{"coveralls":"~2.11.2","mocha":"~2.0.1","istanbul":"~0.3.2"},"gitHead":"831d81498b3d8bd72c1088a1443caf47c9f9abef","_id":"anysort@1.0.0","_shasum":"fe02947d04316976a1ac68ff9ddeb4f1ebb947f6","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"es128","email":"elan.shanker+npm@gmail.com"},"maintainers":[{"name":"es128","email":"elan.shanker+npm@gmail.com"}],"dist":{"shasum":"fe02947d04316976a1ac68ff9ddeb4f1ebb947f6","tarball":"https://registry.npmjs.org/anysort/-/anysort-1.0.0.tgz","integrity":"sha512-ElA+db1NYIep/Pvj9vKzGzW1ZT8AWr+ApqmCUZQi53SxhhYLiLS0ljeZddoGOjX5uU1mJUm6VKFxcOgm5J5wjw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICEcYwzN5rrCBlDwwUA+Y/sN/Y97gspqQokLCQOnrQosAiEAhBzLE9A6gVTToUtXvzK//5Iiz+5Pu2w1iVVSpLDVd64="}]},"directories":{}},"1.0.1":{"name":"anysort","version":"1.0.1","description":"Sorting and matching utility using configurable string, glob, regular expression, and/or function matchers","files":["index.js"],"author":{"name":"Elan Shanker","url":"http://github.com/es128"},"homepage":"https://github.com/es128/anysort","repository":{"type":"git","url":"git+https://github.com/es128/anysort.git"},"bugs":{"url":"https://github.com/es128/anysort/issues"},"keywords":["sort","array","match","any","string","file","fs","list","glob","regex","regexp","regular","expression","function"],"dependencies":{"anymatch":"~1.3.0"},"scripts":{"test":"istanbul cover _mocha && cat ./coverage/lcov.info | coveralls"},"license":"ISC","devDependencies":{"coveralls":"~2.11.2","mocha":"~2.0.1","istanbul":"~0.3.2"},"gitHead":"8eb4212332b019026664e84fcd6b4db127d5bd0e","_id":"anysort@1.0.1","_shasum":"341bd5d5ba1485f64e55ae865f1d45994b507fc4","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"es128","email":"elan.shanker+npm@gmail.com"},"dist":{"shasum":"341bd5d5ba1485f64e55ae865f1d45994b507fc4","tarball":"https://registry.npmjs.org/anysort/-/anysort-1.0.1.tgz","integrity":"sha512-Jyx82eqXUj12nlwJGxI26wi8x9myNuqfG6/y3vbBwzdrZZJWDBdXM0KllCTODGkC17CBuG6vLtbPSoY/c9QkpQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDxL8QtaWQP28FoRGi6RT25y2s1Khwg063CXUmdQSLG2AiBabMmYdH6fnhPvCRxU5JO2O2j9170KDuSo1Hnu6EayqQ=="}]},"maintainers":[{"name":"es128","email":"elan.shanker+npm@gmail.com"}],"directories":{}},"2.0.0":{"name":"anysort","version":"2.0.0","description":"Sorting and matching utility using configurable string, glob, regular expression, and/or function matchers","author":{"name":"Elan Shanker","url":"https://github.com/es128"},"homepage":"https://github.com/es128/anysort","repository":{"type":"git","url":"git+https://github.com/es128/anysort.git"},"bugs":{"url":"https://github.com/es128/anysort/issues"},"keywords":["sort","array","match","any","string","file","fs","list","glob","regex","regexp","regular","expression","function"],"dependencies":{"anymatch":"^3"},"scripts":{"test":"istanbul cover _mocha"},"license":"ISC","devDependencies":{"coveralls":"latest","mocha":"latest","istanbul":"latest"},"gitHead":"7fab0a99a4b0cb66b6c58775add85a1b9f90337f","_id":"anysort@2.0.0","_nodeVersion":"12.12.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-Vo6WEVULAOb5LraoA+6STmR5kr4CsCL4w3Jt8WMdSDH3N9LLpzjIcLnFE2cXZ4v50reshxM4DO/Y16ZHphHxWw==","shasum":"b91e7a820eab1996481cb370824d132f168ff835","tarball":"https://registry.npmjs.org/anysort/-/anysort-2.0.0.tgz","fileCount":4,"unpackedSize":9215,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdvU8TCRA9TVsSAnZWagAAXskP/2XCdNC3bHvMiqRSeVTc\nEvA5Po+hMHYKumacFha5UIEvWaDpN2VkdxAFbz2kJrWleIbGPN4A6I+Stscz\n4fmvHOfQ3e+KoUiSk1vAcmwL7k5uiiBunSS5AYfSsnJUjKl/Zop2HkuVBe8N\n9qor4bx5WC9BvduTTi18JXIpc07nDDm4FS4xORF/bEURprhWe7MwMlkcCfv/\ncZkPAZVTA7pW8S7LNQVaw9wOBh2MpgLxvDWbsEfjGhZUnwZzqfbzhTBCGgmP\nrOINOI5lhdn8NjJMKuKcRO0daIL/UD1mpeSGVRJFQ1ttEYRV9oIqt+qmPve5\ne9scniNpnNIPGXesFn/rNJpMKDl4OH3WoD9RcuKjetGsEZ5rEfkYFULMG6ou\nzUx6GJkcKo5lmoGM6uxlNsAnFAbvl6eaq7+/kwkcpzZlTyoh7jWYGbsfKcMO\noF6T9yxNZ0Vss7KA0RYNjzMUKyL4ZPqTj3nQdDcELnVN6yFlaI/9ILH+M6gh\nC1TAVZm46CQCC1ZZumQr0RcIwOVuKdIJgJbs15eAbJkXNodz94QDHDJCiiT9\nwnQ0+ljOiPdvuFzk8yKhekVMtdcB/CZp7ibzKKLKpI2VD90qsB+cEW1z7l8s\n5FI4+lZJeUkL+k0NMWLPf1i0WjbSZ8Hiuz5gCiPZ9879agMRZApsqHWkuSI8\n8122\r\n=ogx7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCx573CbU6IE8VZjTiNJUrrNpADW34FogUjdgeV5jXC3wIgXNDvze6u0DteTyy9ivSShm5Lsq2X+yHIFHUfKCYzH88="}]},"maintainers":[{"name":"es128","email":"elan.shanker+npm@gmail.com"},{"name":"paulmillr","email":"paul@paulmillr.com"}],"_npmUser":{"name":"paulmillr","email":"paul@paulmillr.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/anysort_2.0.0_1572687634902_0.9322139957219309"},"_hasShrinkwrap":false}},"readme":"anysort [![Build Status](https://travis-ci.org/es128/anysort.svg)](https://travis-ci.org/es128/anysort) [![Coverage Status](https://img.shields.io/coveralls/es128/anysort.svg)](https://coveralls.io/r/es128/anysort)\n=======\nJavascript module to sort arrays of strings using flexible arrays of matchers.\nRegular expressions, globs, plain strings, or functions may be used as matchers\n([see anymatch](https://github.com/es128/anymatch)).\n\n[![NPM](https://nodei.co/npm/anysort.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/anysort/)\n[![NPM](https://nodei.co/npm-dl/anysort.png?height=3&months=9)](https://nodei.co/npm-dl/anysort/)\n\nUsage\n-----\n```sh\nnpm install anysort --save\n```\n\n#### anysort ([a, b,] [matchers])\nIntended for use in an [`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)\ncallback. `matchers` is an array of [anymatch](https://github.com/es128/anymatch)\ncompatible matchers.`a` and `b` are two values to be compared. If called with\nonly `matchers`, returns a function (the `Array.sort` callback). If `matchers`\nis omitted, the array will be sorted naturally (alphabetically). Natural sort\nwill also be used in case of a tie (multiple members matching the same matcher).\n\n```js\nvar anysort = require('anysort');\n\nvar unsorted = [\n\t'path/to/foo.js',\n\t'path/to/bar.js',\n\t'bar.js',\n\t'path/anyjs/baz.js',\n\t'path/anyjs/aaz.js',\n\t'path/to/file.js'\n\t'path/anyjs/caz.js',\n];\n\nvar matchers = [\n\t'path/to/file.js',\n\t'path/anyjs/**/*.js',\n\t/foo.js$/,\n\tfunction (string) {\n\t\treturn string.indexOf('bar') !== -1 && string.length > 10\n\t}\n];\n\n// the following two are equivalent\nunsorted.sort(anysort(matchers));\n\nunsorted.sort(function (a, b){\n\t// except there is an opportunity to run your own\n\t// operations/mutations on a and b here if needed\n\treturn anysort(a, b, matchers);\n});\n/*\n[ 'path/to/file.js',\n\t'path/anyjs/aaz.js',\n\t'path/anyjs/baz.js',\n\t'path/anyjs/caz.js',\n\t'path/to/foo.js',\n\t'path/to/bar.js',\n\t'bar.js' ]\n*/\n```\n\n#### anysort.splice (list, [matchers], [tieBreakers])\nSorts the whole array. Returns an object with `sorted`, `matched`, and\n`unmatched` properties. `matched` is a sorted array of the `list` members that\nmatched any of the `matchers`. `unmatched` is an array of the `list` members\nthat didn't match any `matchers`, sorted natively. `sorted` is a concatenation\nof `matched` and `unmatched`. `tieBreakers` can optionally be specified as a \nsecond set of matchers which will not cause inclusion in the `matched` set, but\nwill be used for fallback sorting in case of ties caused by multiple `list`\narray members matching the same matcher. `tieBreakers` must be an array.\n\n```js\nanysort.splice(unsorted, matchers);\n/*\n{ matched:\n\t [ 'path/to/file.js',\n\t\t 'path/anyjs/aaz.js',\n\t\t 'path/anyjs/baz.js',\n\t\t 'path/anyjs/caz.js',\n\t\t 'path/to/foo.js',\n\t\t 'path/to/bar.js' ],\n\tunmatched: [ 'bar.js' ],\n\tsorted:\n\t [ 'path/to/file.js',\n\t\t 'path/anyjs/aaz.js',\n\t\t 'path/anyjs/baz.js',\n\t\t 'path/anyjs/caz.js',\n\t\t 'path/to/foo.js',\n\t\t 'path/to/bar.js',\n\t\t 'bar.js' ] }\n*/\n\n// quick access to just the sorted array\nanysort.splice(unsorted, matchers).sorted;\n```\n\n#### anysort.grouped (list, [groupedMatchers], [order])\nAllows use of an array of matcher arrays and arbitrary placement of the\nunmatched list members, which is useful if you want to define some to definitely\ngo at the bottom. Also, can be used to create exclusion sets.\n\n`groupedMatchers` should be put in order of priority (in case a `list` member\nmight match multiple). Include the string `'unmatched'` as a top-level member of\n`groupedMatchers` to set the position of any members that do not match any\nmatchers, otherwise it is assumed to belong at the end. `groupedMatchers` also\nsets the order of results, unless an `order` array is defined to override it. If\nan `order` is provided that omits any of the indexes from `groupedMatchers`, the\ncorresponding matches will be excluded from the output.\n\n```js\nvar before = /to/;\nvar after = ['path/anyjs/baz.js', 'path/anyjs/aaz.js'];\nanysort.grouped(unsorted, [before, 'unmatched', after]);\n/*\n[ 'path/to/bar.js',\n\t'path/to/file.js',\n\t'path/to/foo.js',\n\t'bar.js',\n\t'path/anyjs/caz.js',\n\t'path/anyjs/baz.js',\n\t'path/anyjs/aaz.js' ]\n*/\n\nvar exclusions = /anyjs/;\n// 2 is the index for unmatched list members\nanysort.grouped(unsorted, [exclusions, matchers], [2, 1]);\n/*\n[ 'bar.js',\n\t'path/to/file.js',\n\t'path/to/foo.js',\n\t'path/to/bar.js' ]\n*/\n```\n\nChange Log\n----------\n[See release notes page on GitHub](https://github.com/es128/anymatch/releases)\n\nLicense\n-------\n[ISC](https://raw.github.com/es128/anysort/master/LICENSE)\n","maintainers":[{"name":"es128","email":"elan.shanker+npm@gmail.com"},{"name":"paulmillr","email":"paul@paulmillr.com"}],"time":{"modified":"2022-06-13T03:07:55.741Z","created":"2013-11-27T17:48:44.803Z","0.1.0":"2013-11-27T17:48:47.219Z","0.1.1":"2013-11-29T14:53:48.824Z","0.1.2":"2014-01-24T17:01:21.414Z","0.1.3":"2014-01-25T13:59:14.681Z","0.2.0":"2014-06-12T13:23:58.847Z","1.0.0":"2014-11-09T14:02:09.735Z","1.0.1":"2015-12-06T03:48:17.545Z","2.0.0":"2019-11-02T09:40:35.164Z"},"author":{"name":"Elan Shanker","url":"https://github.com/es128"},"repository":{"type":"git","url":"git+https://github.com/es128/anysort.git"},"readmeFilename":"README.md","homepage":"https://github.com/es128/anysort","keywords":["sort","array","match","any","string","file","fs","list","glob","regex","regexp","regular","expression","function"],"bugs":{"url":"https://github.com/es128/anysort/issues"},"license":"ISC"}