Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/floatdrop/path2glob
Get best matching glob from globs array for given path
https://github.com/floatdrop/path2glob
Last synced: about 1 month ago
JSON representation
Get best matching glob from globs array for given path
- Host: GitHub
- URL: https://github.com/floatdrop/path2glob
- Owner: floatdrop
- Created: 2014-09-05T09:17:08.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-22T06:14:37.000Z (almost 10 years ago)
- Last Synced: 2024-10-26T21:10:32.999Z (3 months ago)
- Language: JavaScript
- Size: 160 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# path2glob
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url]
__Deprecated: use [anymatch](https://github.com/es128/anymatch) for this__
Get best matching glob from globs array for given path.
> __Tip__: negatives will be filtered
## Usage
```js
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
[npm-url]: https://npmjs.org/package/path2glob
[npm-image]: http://img.shields.io/npm/v/path2glob.svg?style=flat[travis-url]: http://travis-ci.org/floatdrop/path2glob
[travis-image]: http://img.shields.io/travis/floatdrop/path2glob.svg?branch=master&style=flat[depstat-url]: https://david-dm.org/floatdrop/path2glob
[depstat-image]: http://img.shields.io/david/floatdrop/path2glob.svg?style=flat