Skip to content

🔍 Small library to get all paths that contains one or multiple file names.

Notifications You must be signed in to change notification settings

canastro/query-paths

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

build status npm version codecov

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

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');
});

About

🔍 Small library to get all paths that contains one or multiple file names.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published