Home

Awesome

expand-braces NPM version

Wrapper for [braces] to enable brace expansion for arrays of patterns.

Install

Install with npm

$ npm i expand-braces --save

Usage

var expand = require('expand-braces');

Pass an array or list of strings:

expand('{foo,bar}', '{baz,quux}');
// or
expand(['{foo,bar}', '{baz,quux}']);
// both yield => [ 'foo', 'bar', 'baz', 'quux' ];

Pass a function as the last argument to customize output:

expand(['{a..e}', '{f..h}'], function (str) {
  return '_' + str;
});

//=> ['_a', '_b', '_c', '_d', '_e', '_f', '_g', '_h']

Related projects

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on October 31, 2015.