path2glob

Get best matching glob from globs array for given path


Keywords
glob, path
License
MIT
Install
npm install path2glob@0.0.2

Documentation

path2glob

NPM version Build Status Dependency Status

Deprecated: use anymatch for this

Get best matching glob from globs array for given path.

Tip: negatives will be filtered

Usage

var path2glob = require('path2glob');

var globs = [
    './libs/**/*.js',
    './libs/src/**/*.js',
];

console.log(path2glob('/User/someone/libs/bird/word.js', globs)); // './libs/**/*.js'
console.log(path2glob('/User/someone/libs/src/word.js', globs)); // './libs/src/**/*.js'

API

path2glob(path, globs, [opts])

Returns best matching glob from globs array.

License

MIT (c) 2014 Vsevolod Strukchinsky