1.0.1 • Published 9 years ago

path-search v1.0.1

Weekly downloads
16
License
Unlicense
Repository
github
Last release
9 years ago

path-search npm version

Search files in a path array.

Examples

.
├── parent
│   ├── index.html
│   ├── main.css
│   └── main.js
└── child
    ├── index.html
    └── main.css
var pathSearch = require('path-search');
var path = ['child', 'parent'];

pathSearch(path, 'index.html') === 'child/index.html';
pathSearch(path, 'main.css') === 'child/main.css';
pathSearch(path, 'main.js') === 'parent/main.js';
pathSearch(path, 'troll') === undefined;