1.1.4 • Published 4 years ago

@refabric/loader v1.1.4

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

Refabric Loader

Flexible library load data.

Get Started

Install loader.

npm install @refabric/loader

Load JSON from HTTP.

import { LoaderHTTP } from '@refabric/loader';

const loader = new LoaderHTTP();
loader
  .listContent('https://jsonplaceholder.typicode.com/posts')
  .then((list) => loader.loadContent(list))
  .then((posts) => {
    // use posts here
  });

Load JS/TS files.

import { LoaderFS } from '@refabric/loader';

const loader = new LoaderFS({ root: __dirname, cwd: __dirname });
loader
  .listContent('**.config.ts')
  .then((list) => loader.loadContent(list))
  .then((configs) => {
    // use configs here
  });
1.1.4

4 years ago