glob-slasher

    1.0.1 • Public • Published

    glob-slasher

    Prefix an object (key/values) of globs with a slash and normalize. Supports negated globs too. Glob version of slasher module

    Install

    npm install glob-slasher --save
    

    Usage

    Strings

    var slasher = require('glob-slasher');
     
    var pathname = '!**/something';
    console.log(slasher(pathname)); // OUTPUTS: '!/**/something'

    Arrays

    var slasher = require('glob-slasher');
     
    var globs = ['!**/something', '/here'];
    console.log(slasher(globs)); // OUTPUTS: ['!/**/something', '/here']

    Objects

    var slasher = require('glob-slasher');
     
    var globs = {
      '**/some/route': 'index.html'
    };
    console.log(slasher(globs));
     
    // OUTPUTS:
    {
      '/**/some/route': '/index.html'
    }

    Run Tests

    npm install
    npm test
    

    Install

    npm i glob-slasher

    DownloadsWeekly Downloads

    269,417

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • avatar