# tiny-loader

> minimal JavaScript loader, intended for loading polyfills up front

Latest version **2.0.0** (published 2020-05-19) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install tiny-loader
pnpm add tiny-loader
yarn add tiny-loader
bun add tiny-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 | 2.0.0 |
| Published | 2020-05-19 |
| First published | 2017-04-22 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | FND |
| Maintainers | fnd |

## Links

- npm: https://www.npmjs.com/package/tiny-loader
- Repository: https://github.com/FND/tiny-script-loader
- Issues: https://github.com/FND/tiny-script-loader/issues
- npm.io page: https://npm.io/package/tiny-loader

## Recent versions

- 2.0.0 (latest) — 2020-05-19
- 1.2.0 — 2019-05-14
- 1.1.0 — 2019-02-25
- 1.0.2 — 2017-04-22
- 1.0.1 — 2017-04-22
- 1.0.0 — 2017-04-22

## README

tiny, dependency-free JavaScript loader — intended primarily for loading
polyfills or common libraries up front

```javascript
loadScripts(["foo.js", "bar.js", "baz.js"], function() {
    // all aforementioned scripts have been loaded
});
```

(scripts are loaded and executed sequentially)

you can also pass an object in order to assign arbitrary attributes to the
generated `script` tag, e.g. for
[Subresource Integrity](https://www.w3.org/TR/SRI/):

```javascript
loadScripts([{
    src: "https://cdn.example.org/lib.js",
    integrity: "sha256-Ijl…1bE=",
    crossorigin: "anonymous"
}]);
```

prompted by
[Loading Polyfills Only When Needed](https://philipwalton.com/articles/loading-polyfills-only-when-needed/),
which explains why `document.write` should be avoided

see `samples` directory for usage examples

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