Coder Social home page Coder Social logo

glob-rules's Introduction

#glob-rules Build Status

Dependency Status devDependency Status GitHub version

Test or transform filesystem paths with glob-like rules

If minimatch works like 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

Copyright and license

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

Total views Views in the last 24 hours library users xrefs

glob-rules's People

Contributors

evgenus avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

glob-rules's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.