Socket
Socket
Sign inDemoInstall

glob-rules

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    glob-rules

Test and transform filesystem paths with glob-like rules


Version published
Maintainers
1
Install size
16.3 kB
Created

Readme

Source

#glob-rules Build Status

Dependency Status devDependency Status GitHub version

Test or transform filesystem paths with glob-like rules

If minimatch works line RegEx.test, then glob-rules works like RegEx.replace. If you don't need replacing parts of matched filesystem path, or you need feature rich matcher, then use minimatch. This library is for copy/move/transfrom functionality, like inside building scripts.

##Features

  • * matching single path segment of any length including 0
  • ** matching subpath of any length including 0
  • ? matching single character of segment
  • replacing could be achived with brackets like in regular expressions

##Examples

var glob_rules = require("glob-rules");

// bulding minifying
var transformer = glob_rules.transformer("./src/(**).js", "./build/$1-min.js");
console.log(transformer("./src/app.js")); // ./build/app-min.js
console.log(transformer("./src/module/func.js")); // ./build/module/func-min.js

// compiling coffee-script
var transformer = glob_rules.transformer("./src/(**).coffee", "./build/$1.js");
console.log(transformer("./src/app.coffee")); // ./build/app.js
console.log(transformer("./src/module/func.coffee")); // ./build/module/func.js

Code and documentation copyright 2014 Eugene Chernyshov. Code released under the MIT license.

Total views Views in the last 24 hours library users xrefs

Keywords

FAQs

Last updated on 01 Jul 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc