1.0.7 • Published 5 years ago

@iutlannion/charger-dossier v1.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

charger-dossier

This module loads all JavaScript files in a folder and its subfolders and generates an object which represents the file tree where each folder is an object and each file a variable whose value is what the file returned or contains.

Quick start

You only have to require the module and then give it a folder name:

const chargerDossier = require("charger-dossier")
const myFolder = chargerDossier("./myfoldername")

console.log(myFolder instance of Object) // true
console.log(myFolder.mySubFolder.myScriptFile) // prints the `exports`ed value
console.log(myFolder.mySubFolder.myTextFile) // prints the file content (if activated in the options, see below)

Options

The module waits for a required parameter folderName and an optional second parameter options object.

Options are:

Warning

The behavior of this module is undefined if it encounters both a folder and a file with the same name (extension apart). You should not do that as one will overwrite the other one.

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago