@nova-ts/context
Version:
A TypeScript library for Dependency Injection
21 lines (20 loc) • 542 B
JavaScript
// src/Scanner/AutoBind.ts
import fg from "fast-glob";
import path from "path";
import { pathToFileURL } from "url";
var bootstrapped = false;
async function autoBind(baseDir) {
if (bootstrapped) return;
bootstrapped = true;
const files = await fg(`${baseDir}/**/*.js`);
console.log("Auto-binding files:", files);
for (const file of files) {
const fullPath = path.resolve(file);
const fileUrl = pathToFileURL(fullPath).href;
await import(fileUrl);
}
}
export {
autoBind
};
//# sourceMappingURL=chunk-43UJ4EPI.js.map