https://github.com/canastro/query-paths
🔍 Small library to get all paths that contains one or multiple file names.
https://github.com/canastro/query-paths
Last synced: 7 days ago
JSON representation
🔍 Small library to get all paths that contains one or multiple file names.
- Host: GitHub
- URL: https://github.com/canastro/query-paths
- Owner: canastro
- Created: 2017-01-14T19:12:04.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-15T17:50:49.000Z (over 9 years ago)
- Last Synced: 2025-10-01T13:52:14.063Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

[](https://badge.fury.io/js/query-paths)
[](https://codecov.io/gh/canastro/query-paths)
# query-paths
Small library to get all paths that contains one or multiple file names.
## How it works
This module is a composed by a recursive function that will travel down the root directory gathering the ones that match all the query.
## Usage
```js
var queryPaths = require('../src/index');
const first = queryPaths('/Users/username/dev', 'notfound');
first.on('data', (path) => {
console.log('first: ', path);
});
first.on('end', () => {
console.log('first ended');
});
const second = queryPaths('/Users/username/dev', 'package.json');
second.on('data', (path) => {
console.log('second: ', path);
});
second.on('end', () => {
console.log('second ended');
});
const third = queryPaths('/Users/username/dev', ['.git', 'package.json']);
third.on('data', (path) => {
console.log('third: ', path);
});
third.on('end', () => {
console.log('third ended');
});
```