AlexBrandes / load-from-directory

Loads all nodejs modules from the given directory into an array

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Loads all nodejs modules from the given directory into an array


Languages

Language:JavaScript 100.0%