|
%!s(int64=5) %!d(string=hai) anos | |
---|---|---|
.. | ||
.npmignore | %!s(int64=5) %!d(string=hai) anos | |
LICENSE | %!s(int64=5) %!d(string=hai) anos | |
README.md | %!s(int64=5) %!d(string=hai) anos | |
index.js | %!s(int64=5) %!d(string=hai) anos | |
package.json | %!s(int64=5) %!d(string=hai) anos |
npm install require-dot-file
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');