Socket
Socket
Sign inDemoInstall

indexport

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    indexport

index.js made DRYer. Exports all the modules in a directory in just one sentence


Version published
Maintainers
1
Install size
4.43 kB
Created

Readme

Source

indexport Build Status

Node's index.js modules made DRYer. Just export all the modules in a directory in one sentence.

Not clear enough? Ok, let me give you an example:

Instead of writting the following index.js file:

module.exports = {
  moduleA: require('./module-a'),
  moduleB: require('./module-b'),
  moduleC: require('./module-c'),
  moduleD: require('./module-d'),
  ...
}

With indexport you can do:

module.exports = require('indexport')(__dirname)

Conclusion: the exported interface are exactly the same.

Installation

npm install indexport --save

Usage

In your index.js JS file:

module.exports = require('indexport')(__dirname)

API

indexport(directory) => object

Returns an object map with the exported modules.

License

MIT - Tomas Aparicio

Keywords

FAQs

Last updated on 29 Oct 2015

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc