JSPM

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

Recursively walks dot folders looking for a config file

Package Exports

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

Readme

Install

npm install require-dot-file

Usage

This is a simple module used for recursively searching across all parent folders for a file to require.

For example you may want to allow a user to include a dotfile to allow users to configure your project that they can include in their project root.

var
  requireDotFile = require('require-dot-file')
;

// searches for .myconfig in all parent dir recursively (including current dir)
var config = requireDotFile('.myconfig');

// searches for .myconfig file in /path/to/start and its parent dirs
var config = requireDotFile('.myconfig', '/path/to/start');