Borrus-sudo / expressive-glob

💡 Write glob patterns in super expressive and an easy way!

Home Page:https://www.npmjs.com/package/expressive-glob

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

💡expressive-glob

All Contributors License Last Commit Stars Forks

Philosophy

This package uses the fluent builder pattern. Its main goal is to make the somewhat cryptic vocabulary of glob patterns easy to understand!

Usage

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]");

Installation

yarn add expressive-glob or npm i expressive-glob

Inspiration

This project is inspired by super-expressive!

🎉 Contributing

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

👥 Contributors

About

💡 Write glob patterns in super expressive and an easy way!

https://www.npmjs.com/package/expressive-glob

License:MIT License


Languages

Language:TypeScript 87.6%Language:JavaScript 8.4%Language:Shell 4.0%