recursively imports all files in a directory
# npm
npm install import-directories
# yarn
yarn add import-directories
import {importDirectory} from "import-directories"
const foo = await importDirectory("./foo")
console.log(foo)
// => { "/bar.js": { foobar: 2 } }
import {importDirectory} from "import-directories"
const foo = await importDirectory("./foo", {removeExtensionFile: true})
console.log(foo)
// => { "/bar": { foobar: "Hello World" } }
import {importDirectory} from "import-directories"
const foo = await importDirectory("./foo", {keepPathOnKey: true})
console.log(foo)
// => { "/home/user/foo/bar.js": { foobar: "raboof" } }
import {importDirectory} from "import-directories"
const foo = await importDirectory("./foo", {prefixKey: "/foobar-app"})
console.log(foo)
// => {
// "/foobar-app/foo.js": { foo: "bar" }
// "/foobar-app/bar.js": { bar: "foo" }
// }