filestack-loader

3.0.4 • Public • Published

Loader

Installation

npm install filestack-loader

Usage

Loading JavaScript Modules

If you have two modules a.js and b.js and you want to load b into a...

// file a.js
import loader from 'loader';
 
loader.loadModule('url/to/b.js').then((b) => {
  b.helloWorld();
});
// file b.js
import loader from 'loader';
 
const api = {
  helloWorld() {
    console.log('Hello world!');
  },
};
 
// Module need to "tell" the loader that it's loaded and ready.
loader.registerReadyModule(api);

Loading CSS

import loader from 'loader';
 
loader.loadCss('url/to/style.css').then(() => {
  console.log('Style loaded!');
});

Development

Setup

npm install

Testing

Unit

npm test

This command opens in the browser semi-manual tests. Those tests don't have watch, so you need to refire the command with each change.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 3.0.4
    4,963
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 3.0.4
    4,963
  • 3.0.3
    0
  • 3.0.2
    0
  • 3.0.1
    0

Package Sidebar

Install

npm i filestack-loader

Weekly Downloads

4,963

Version

3.0.4

License

SEE LICENSE IN LICENSE

Unpacked Size

22.7 kB

Total Files

8

Last publish

Collaborators

  • filestack-dev