0.3.2 • Published 1 year ago

@netleaf/extensions-file-provider v0.3.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@NetLeaf/extensions-file-provider

FileProvider extension for NetLeaf application host framework.

Usage

import { IFileProvider, PhysicalFileProvider } from "@netleaf/extensions-file-provider";

const fileProvider: IFileProvider = new PhysicalFileProvider(process.cwd());
const fileInfo = await fileProvider.getFileInfo("config.json");

if (fileInfo.exists && !fileInfo.isDirectory)
{
	const config = await import(fileInfo.path);
	console.log(fileInfo.name, config);
}