This package uses the fluent builder pattern
. Its main goal is to make the somewhat cryptic vocabulary of glob patterns easy to understand!
const glob = new ExpressiveGlob();
const globString1 = glob.capture.anyChar
.string(".jpg")
.anyChar.upto(2)
.from("ABCDE")
.end.toGlob();
glob.flush();
const globString2 = glob.capture.anyChar
.string(".png")
.anyChar.from(2, 5)
.invert.end.toGlob();
expect(globString1).toBe("*.jpg??[ABCDE]");
expect(globString2).toBe("*.png*[!2-5]");
yarn add expressive-glob
or npm i expressive-glob
This project is inspired by super-expressive!
Contributions are welcome! Whether it is a small documentation change or a breaking feature, we welcome it!
Please note: All contributions are taken under the MIT license