New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

require-plus

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

require-plus

better require for modules

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by66.67%
Maintainers
1
Weekly downloads
 
Created
Source

#require-plus

Node module for loading js files via require when supplied with a valid directory, if the directory is not valid it will throw. It will also throw if the object is not exported properly or cannot be resolved through require.

##Installation

npm install require-plus

##Usage

var requirePlus = require('require-plus');
var options : {
    blacklist: ['node_modules', '.git', '.idea'],
    extensions: ['.js','.json']
};
// if options are not set the standard defaults shown above will be applied
var results = requirePlus('./routes', options);
console.log(results);
//results will be a object set of objects with the keys showing a representation of file tree

##Todo

  • Add tests

  • Blacklist directories

  • Bypass any EPREM with file permission issues

  • Improve hash object created (recursively) to be keys representing position in file system, for example if a module is in /some/path/file.js the returned object should be

    {some:{path:{file: object}}};

Keywords

FAQs

Package last updated on 23 Mar 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