JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2167
  • Score
    100M100P100Q25045F
  • License MIT

Search for a file in an array of paths

Package Exports

  • find-file

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (find-file) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

find-file Build Status

Search for a file in an array of paths using Node.js.

Getting started

Install with npm: npm install find-file

Examples

var findFile = require('find-file');

// search for gifsicle in `vendor` and `../bin`
findFile('gifsicle', ['vendor', '../bin']);

// search for gifsicle in `vendor` and `../bin` but exclude `PATH`
findFile('gifsicle', ['vendor', '../bin'], false);

// search for gifsicle in `vendor` and `PATH` but only return the first one
findFile('gifsicle', 'vendor')[0];

API

findFile(name, dirs, excludes, global)

Search for a file in an array of paths. By default it will also search for files in PATH.

License

MIT License (c) Kevin Mårtensson