load-from-directory

1.1.0 • Public • Published

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"
}

Package Sidebar

Install

npm i load-from-directory

Weekly Downloads

64

Version

1.1.0

License

MIT

Unpacked Size

9.72 kB

Total Files

9

Last publish

Collaborators

  • frenchie4111