brace-expand-join
v0.2.0
Published
Join and normalize glob patterns considering brace expansion
Downloads
5,014
Maintainers
Readme
brace-expand-join
A Node module to join and normalize glob patterns considering brace expansion
var braceExpandJoin = require('brace-expand-join');
braceExpandJoin('{a,b}', 'c'); //=> '{a/c,b/c}'
braceExpandJoin('{a,b}', '{c,d}'); //=> '{a/c,a/d,b/cb/d}'
braceExpandJoin('{a,b,c/d}', '../', 'e'); //=> '{e,c/e}'
Installation
npm
npm install --save brace-expand-join
bower
bower install --save brace-expand-join
API
var braceExpandJoin = require('brace-expand-join');
braceExpandJoin(pattern0 [, pattern1, ...])
pattern0 [, pattern1, ...]: String
Return: String
It joins patterns like path.join() expanding each part of brace expansions, and returns a new single glob pattern.
braceExpandJoin('{,a{b,c}}', '{,d{e,f}}', '{,g{h,i}}')
// => '{.,gh,gi,de,de/gh,de/gi,df,df/gh,df/gi,ab,ab/gh,ab/gi,ab/de,ab/de/gh,ab/de/gi,ab/df,ab/df/gh,ab/df/gi,ac,ac/gh,ac/gi,ac/de,ac/de/gh,ac/de/gi,ac/df,ac/df/gh,ac/df/gi}'
License
Copyright (c) 2014 Shinnosuke Watanabe
Licensed under the MIT License.