0.0.1-beta.0 • Published 5 years ago

file-list-loader v0.0.1-beta.0

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

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