JSPM

include-path-searcher

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

Helper functions for searching for files in multiple include paths

Package Exports

  • include-path-searcher

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 (include-path-searcher) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

include-path-searcher

Build Status

Utility functions for searching multiple include paths.

Installation

npm install --save include-path-searcher

Usage

var includePathSearcher = require('include-path-searcher')

findFileSync

includePathSearcher.findFileSync(relativePath, includePaths) // => fullPath

Searches for the file identified by relativePath in any of the given directories (includePaths). Returns the full path of the first file found, or throws an error if none found. For example:

includePathSearcher.findFileSync('foo.txt', ['dir1', 'dir2'])

This returns either 'dir1/foo.txt' or 'dir2/foo.txt'. If foo.txt does not exist in either directory, it throws an error.