file-list-loader

0.0.1-beta.0 • Public • Published

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.

Build Status Coverage Status

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.js
  • npm run lint:fix: Check the code and try to fix it.

License

MIT

Package Sidebar

Install

npm i file-list-loader

Weekly Downloads

4

Version

0.0.1-beta.0

License

MIT

Unpacked Size

21.8 kB

Total Files

25

Last publish

Collaborators

  • curlirojo