Socket
Socket
Sign inDemoInstall

req-all

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    req-all

Require all files in a directory


Version published
Weekly downloads
158K
decreased by-0.29%
Maintainers
1
Install size
4.79 kB
Created
Weekly downloads
 

Readme

Source

req-all Build Status

Require all files in a directory

This module is intentionally simple. Not interested in more features.

Install

$ npm install --save req-all

Usage

.
└── dir
    ├── foo-bar.js
    └── baz-faz.js
const reqAll = require('req-all');
const modules = reqAll('dir');

console.log(modules);
//=> {fooBar: [Function], bazFaz: [Function]}

API

reqAll([directory], [options])

directory

Type: string
Default: __dirname

Directory to require supported files in. Unless you've modified require.extensions, that means any .js, .json, .node files, in that order. Does not recurse. Ignores the caller file and files starting with . or _.

options

Type: Object

camelize

Type: boolean
Default: true

Convert dash-style names (foo-bar) to camel-case (fooBar).

License

MIT © Sindre Sorhus

Keywords

FAQs

Last updated on 05 Jul 2016

Did you know?

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc