1.1.0 • Published 4 years ago

load-from-directory v1.1.0

Weekly downloads
99
License
MIT
Repository
github
Last release
4 years ago

load-from-directory

Loads all nodejs modules from the given directory into an array

Usage

Filetree:

  • index.js
  • test_directory/
    • test.js

test.js:

module.exports = 'test_string_in_file'

index.js:

var load_from_directory = require( 'load_from_directory' );
var loaded = load_from_directory.load( 'test_directory' );
console.log( loaded );

Output:

{
    "test": "test_string_in_file"
}