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

et-al

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

et-al

Easily require all modules in a sub-directory and return them in an array.

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

et-al

Easily require all modules in a sub-directory and return them in an array.

Usage

Of course:

npm install --save et-al

Now let's say you have a directory structure like this:

  • my-app.js
  • models/
    • index.js
    • foo.js
    • bar.js

You want to be able to get all your models (excluding index.js) in my-app.js like this:

var models = require('./models');
// models now contains an array of the model modules
// i.e. [foo, bar]

models.forEach(function(model) {
  // do something with it
});

All you have to do is put this line in models/index.js:

module.exports = require('et-al');

Voila!

Coming Soon

Recursive loading and configurable behavior

Keywords

FAQs

Package last updated on 18 Nov 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