1.0.8 • Published 4 years ago

index_creator v1.0.8

Weekly downloads
4
License
ISC
Repository
github
Last release
4 years ago

Usage

Just require the package on the index file and assign to module.exports, give it the __dirname thats it!

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

Config

require('index_creator')(
  __dirname, 
  config = {
    caseType?: 'camel' | 'pascal' = 'pascal', 
    excludePattern?: String | RegExp = 'index.js',
    removeExtension?: Boolean = true
  }
);
  • caseType Switch if use camel or pascal case to create the module.exports property name.
  • exludePatter Pattern that if a file or folder match will be excluded from the final object.
  • removeExtension Switch if the package will remove the last '.some' or not. If a file has no dots on it's name will stay as is.

NOTE: if the dir has subdirs it will need a index too to work or should be explicitly ignored on excludePattern.

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago