Socket
Socket
Sign inDemoInstall

require-dot-file

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

require-dot-file

Recursively walks parent folders looking for a config file


Version published
Weekly downloads
8.4K
decreased by-12.53%
Maintainers
2
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 20 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc