# filestack-loader

> ## Installation

Latest version **3.0.4** (published 2018-04-03) · SEE LICENSE IN LICENSE license · 0 weekly downloads

## Install

```sh
npm install filestack-loader
pnpm add filestack-loader
yarn add filestack-loader
bun add filestack-loader
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.4 |
| Published | 2018-04-03 |
| First published | 2018-03-23 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 22.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | filestack-dev |

## Links

- npm: https://www.npmjs.com/package/filestack-loader
- npm.io page: https://npm.io/package/filestack-loader

## Recent versions

- 3.0.4 (latest) — 2018-04-03
- 3.0.3 — 2018-04-02
- 3.0.2 — 2018-03-23
- 3.0.1 — 2018-03-23

## README

# 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`...

```js
// file a.js
import loader from 'loader';

loader.loadModule('url/to/b.js').then((b) => {
  b.helloWorld();
});
```

```js
// 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

```js
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.

---
_Source: https://npm.io/package/filestack-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
