JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6001634
  • Score
    100M100P100Q199818F
  • License MIT

Write minimal node index.js/index.coffee files that require and export all their siblings by file basename

Package Exports

  • requireindex

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (requireindex) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Description

Write minimal node index.js/index.coffee files that require and export all their siblings by file basename

Installation

npm install requireindex

Usage

Check the test directory for example usage. The directory tree looks like:

-lib/
  -index.js
  -Foo.js
  -bar/
    index.js
    f.js
    fing.js
  -bam.js

The index.js files look like this:

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

and the result of

require('lib')

is this:

{
  bam: { 
    m: [Function] 
  },
  bar: { 
    f: [Function],
    fing: [Function] 
  },
  Foo: { 
    l: [Function], 
    ls: [Function] 
  } 
}