JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2013
  • Score
    100M100P100Q25048F
  • 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', { path: ['vendor', '../bin'] });

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

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

API

findFile(name, opts)

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

Options

path

Type: String|Array
Default: undefined

Paths to search in.

exclude

Type: String|Array
Default: undefined

Paths to exclude.

global

Type: Boolean
Default: true

Whether to search in PATH.

License

MIT License (c) Kevin Mårtensson