Licence
MIT
Version
0.0.1-beta.0
Deps
0
Size
21 kB
Vulns
0
Weekly
0
file-list-loader
A file loader that after searched in a path (or paths) recursively, generate an ID for each file based in the name.
Installation
Install by npm
npm install --save file-list-loader
Basic Usage
/
└── Users
└── jsons
├── unicorn.json
└── foo
└── bar
├── baz
└── one.json
import {MikroOrmModuleDefiner} from "file-list-loader";
const loader = new FileListLoader({
extensions: ['json'],
useFilePathInId: false
});
await loader.addPaths({path: './jsons'});
const oneContent = await loader.getFileContent('one');
const unicornContent = await loader.getFileContent('unicorn');
Commands
npm run build: Build the project (file list loader).npm run build:clean: Delete first the dist folder and build it.npm run clean: Delete the dist folder.npm run test: Execute the tests.npm run test:coverage: Execute the tests and calculate the coverage.npm run lint: Check the code using the rules in .eslintre.jsnpm run lint:fix: Check the code and try to fix it.
License
MIT