wishthis/node_modules/require-dot-file
2022-04-08 12:55:35 +02:00
..
.npmignore Add production dependencies 2022-01-21 09:28:41 +01:00
index.js Add production dependencies 2022-01-21 09:28:41 +01:00
LICENSE Add production dependencies 2022-01-21 09:28:41 +01:00
package.json Install yarn 2022-04-08 12:55:35 +02:00
README.md Add production dependencies 2022-01-21 09:28:41 +01:00

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');