@refabric/loader
TypeScript icon, indicating that this package has built-in type declarations

1.1.4 • Public • Published

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
  });

Readme

Keywords

none

Package Sidebar

Install

npm i @refabric/loader

Weekly Downloads

1

Version

1.1.4

License

ISC

Unpacked Size

10.6 kB

Total Files

17

Last publish

Collaborators

  • popon