UNPKG

motion

Version:

motion - moving development forward

97 lines (96 loc) 8.27 kB
{ "_args": [ [ "braces@https://registry.npmjs.org/braces/-/braces-1.8.3.tgz", "/Users/nw/flint/packages/flint" ] ], "_from": "braces@>=1.8.2 <2.0.0", "_id": "braces@1.8.3", "_inCache": true, "_location": "/braces", "_phantomChildren": {}, "_requested": { "name": "braces", "raw": "braces@https://registry.npmjs.org/braces/-/braces-1.8.3.tgz", "rawSpec": "https://registry.npmjs.org/braces/-/braces-1.8.3.tgz", "scope": null, "spec": "https://registry.npmjs.org/braces/-/braces-1.8.3.tgz", "type": "remote" }, "_requiredBy": [ "/micromatch" ], "_resolved": "https://registry.npmjs.org/braces/-/braces-1.8.3.tgz", "_shasum": "35d4e7dda632b33e215d38a8a9cf4329c9c75d2c", "_shrinkwrap": null, "_spec": "braces@https://registry.npmjs.org/braces/-/braces-1.8.3.tgz", "_where": "/Users/nw/flint/packages/flint", "author": { "name": "Jon Schlinkert", "url": "https://github.com/jonschlinkert" }, "bugs": { "url": "https://github.com/jonschlinkert/braces/issues" }, "dependencies": { "expand-range": "^1.8.1", "preserve": "^0.2.0", "repeat-element": "^1.1.2" }, "description": "Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces specification.", "devDependencies": { "benchmarked": "^0.1.3", "brace-expansion": "^1.1.0", "chalk": "^0.5.1", "minimatch": "^2.0.1", "minimist": "^1.1.0", "mocha": "*", "should": "*" }, "engines": { "node": ">=0.10.0" }, "files": [ "index.js", "utils.js" ], "homepage": "https://github.com/jonschlinkert/braces", "keywords": [ "alpha", "alphabetical", "bash", "brace", "expand", "expansion", "filepath", "fill", "fs", "glob", "globbing", "letter", "match", "matches", "matching", "number", "numerical", "path", "range", "ranges", "sh" ], "license": "MIT", "main": "index.js", "name": "braces", "optionalDependencies": {}, "readme": "# braces [![NPM version](https://badge.fury.io/js/braces.svg)](http://badge.fury.io/js/braces)\n\n> Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces specification.\n\n* Complete support for the braces part of the [Bash 4.3 Brace Expansion](www.gnu.org/software/bash/). Braces passes [all of the relevant unit tests](#bash-4-3-support) from the spec.\n* Expands comma-separated values: `a/{b,c}/d` => `['a/b/d', 'a/c/d']`\n* Expands alphabetical or numerical ranges: `{1..3}` => `['1', '2', '3']`\n* [Very fast](#benchmarks)\n* [Special characters](./patterns.md) can be used to generate interesting patterns.\n\nInstall with [npm](https://www.npmjs.com/)\n\n```sh\n$ npm i braces --save\n```\n\n## Example usage\n\n```js\nvar braces = require('braces');\n\nbraces('a/{x,y}/c{d}e')\n//=> ['a/x/cde', 'a/y/cde']\n\nbraces('a/b/c/{x,y}')\n//=> ['a/b/c/x', 'a/b/c/y']\n\nbraces('a/{x,{1..5},y}/c{d}e')\n//=> ['a/x/cde', 'a/1/cde', 'a/y/cde', 'a/2/cde', 'a/3/cde', 'a/4/cde', 'a/5/cde']\n```\n\n### Pro tip!\n\n> Use braces to generate test fixtures!\n\n**Example**\n\n```js\nvar braces = require('./');\nvar path = require('path');\nvar fs = require('fs');\n\nbraces('blah/{a..z}.js').forEach(function(fp) {\n if (!fs.existsSync(path.dirname(fp))) {\n fs.mkdirSync(path.dirname(fp));\n }\n fs.writeFileSync(fp, '');\n});\n```\n\nSee the [tests](./test/test.js) for more examples and use cases (also see the [bash spec tests](./test/bash-mm-adjusted.js));\n\n### Range expansion\n\nUses [expand-range](https://github.com/jonschlinkert/expand-range) for range expansion.\n\n```js\nbraces('a{1..3}b')\n//=> ['a1b', 'a2b', 'a3b']\n\nbraces('a{5..8}b')\n//=> ['a5b', 'a6b', 'a7b', 'a8b']\n\nbraces('a{00..05}b')\n//=> ['a00b', 'a01b', 'a02b', 'a03b', 'a04b', 'a05b']\n\nbraces('a{01..03}b')\n//=> ['a01b', 'a02b', 'a03b']\n\nbraces('a{000..005}b')\n//=> ['a000b', 'a001b', 'a002b', 'a003b', 'a004b', 'a005b']\n\nbraces('a{a..e}b')\n//=> ['aab', 'abb', 'acb', 'adb', 'aeb']\n\nbraces('a{A..E}b')\n//=> ['aAb', 'aBb', 'aCb', 'aDb', 'aEb']\n```\n\nPass a function as the last argument to customize range expansions:\n\n```js\nvar range = braces('x{a..e}y', function (str, i) {\n return String.fromCharCode(str) + i;\n});\n\nconsole.log(range);\n//=> ['xa0y', 'xb1y', 'xc2y', 'xd3y', 'xe4y']\n```\n\nSee [expand-range](https://github.com/jonschlinkert/expand-range)for benchmarks, tests and the full list of range expansion features.\n\n## Options\n\n### options.makeRe\n\nType: `Boolean`\n\nDeafault: `false`\n\nReturn a regex-optimal string. If you're using braces to generate regex, this will result in dramatically faster performance.\n\n**Examples**\n\nWith the default settings (`{makeRe: false}`):\n\n```js\nbraces('{1..5}');\n//=> ['1', '2', '3', '4', '5']\n```\n\nWith `{makeRe: true}`:\n\n```js\nbraces('{1..5}', {makeRe: true});\n//=> ['[1-5]']\n\nbraces('{3..9..3}', {makeRe: true});\n//=> ['(3|6|9)']\n```\n\n### options.bash\n\nType: `Boolean`\n\nDefault: `false`\n\nEnables complete support for the Bash specification. The downside is a 20-25% speed decrease.\n\n**Example**\n\nUsing the default setting (`{bash: false}`):\n\n```js\nbraces('a{b}c');\n//=> ['abc']\n```\n\nIn bash (and minimatch), braces with one item are not expanded. To get the same result with braces, set `{bash: true}`:\n\n```js\nbraces('a{b}c', {bash: true});\n//=> ['a{b}c']\n```\n\n### options.nodupes\n\nType: `Boolean`\n\nDeafault: `true`\n\nDuplicates are removed by default. To keep duplicates, pass `{nodupes: false}` on the options\n\n## Bash 4.3 Support\n\n> Better support for Bash 4.3 than minimatch\n\nThis project has comprehensive unit tests, including tests coverted from [Bash 4.3](www.gnu.org/software/bash/). Currently only 8 of 102 unit tests fail, and\n\n## Run benchmarks\n\nInstall dev dependencies:\n\n```bash\nnpm i -d && npm benchmark\n```\n\n```bash\n#1: escape.js\n brace-expansion.js x 114,934 ops/sec ±1.24% (93 runs sampled)\n braces.js x 342,254 ops/sec ±0.84% (90 runs sampled)\n\n#2: exponent.js\n brace-expansion.js x 12,359 ops/sec ±0.86% (96 runs sampled)\n braces.js x 20,389 ops/sec ±0.71% (97 runs sampled)\n\n#3: multiple.js\n brace-expansion.js x 114,469 ops/sec ±1.44% (94 runs sampled)\n braces.js x 401,621 ops/sec ±0.87% (91 runs sampled)\n\n#4: nested.js\n brace-expansion.js x 102,769 ops/sec ±1.55% (92 runs sampled)\n braces.js x 314,088 ops/sec ±0.71% (98 runs sampled)\n\n#5: normal.js\n brace-expansion.js x 157,577 ops/sec ±1.65% (91 runs sampled)\n braces.js x 1,115,950 ops/sec ±0.74% (94 runs sampled)\n\n#6: range.js\n brace-expansion.js x 138,822 ops/sec ±1.71% (91 runs sampled)\n braces.js x 1,108,353 ops/sec ±0.85% (94 runs sampled)\n```\n\n## Run tests\n\nInstall dev dependencies:\n\n```bash\nnpm i -d && npm test\n```\n\n## Related\n\n* [micromatch](https://github.com/jonschlinkert/micromatch): wildcard/glob matcher for javascript. a faster alternative to minimatch.\n* [fill-range](https://github.com/jonschlinkert/fill-range): Fill in a range of numbers or letters, optionally passing an increment or multiplier to use\n* [expand-range](https://github.com/jonschlinkert/expand-range): Wraps fill-range for fast, bash-like range expansion in strings. Expand a range of numbers or letters, uppercase or lowercase\n\n## Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/braces/issues).\n\nPlease run benchmarks before and after any code changes to what the impact of the code changes are before submitting a PR.\n\n## Author\n\n**Jon Schlinkert**\n\n+ [github/jonschlinkert](https://github.com/jonschlinkert)\n+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)\n\n## License\n\nCopyright © 2014-2015 Jon Schlinkert\nReleased under the MIT license.\n\n***\n\n_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 19, 2015._\n\n<!-- deps:mocha -->", "readmeFilename": "README.md", "repository": { "type": "git", "url": "git+https://github.com/jonschlinkert/braces.git" }, "scripts": { "test": "mocha" }, "version": "1.8.3" }