# popoload

> Load script and css.

Latest version **1.0.9** (published 2018-10-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install popoload
pnpm add popoload
yarn add popoload
bun add popoload
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.9 |
| Published | 2018-10-10 |
| First published | 2018-08-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 174.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | DaShun |
| Maintainers | dashun |

## Links

- npm: https://www.npmjs.com/package/popoload
- Repository: https://github.com/shunok/popoload
- Homepage: https://github.com/shunok/popoload#readme
- Issues: https://github.com/shunok/popoload/issues
- npm.io page: https://npm.io/package/popoload

## Recent versions

- 1.0.9 (latest) — 2018-10-10
- 1.0.8 — 2018-10-10
- 1.0.7 — 2018-10-10
- 1.0.6 — 2018-10-09
- 1.0.5 — 2018-10-01
- 1.0.4 — 2018-10-01
- 1.0.3 — 2018-10-01
- 1.0.2 — 2018-09-28
- 1.0.1 — 2018-09-13
- 1.0.0 — 2018-08-28

## README

# Script and Style file resource load tool

[中文介绍](./readme_cn.md)

In some application scenarios, we need to customize the loading of certain Javascript plug-ins based on configuration, usually including plug-in dependency scripts and styles. Pooload can load plug-ins and their dependencies through configuration.

## Install

```js
npm i popoload
```

or

```js
<script src="./js/popoload.min.js"></script>
```

## Use

```js

PL({
    config: {
        path: {
            bootcdn: 'https://cdn.bootcss.com/'
        }
    },
    libs: [
        'bootcdn:jquery/3.1.1/jquery.min.js',
        'bootcdn:leaflet/1.3.1/leaflet.js'
    ],
    styles: [
        'bootcdn:leaflet/1.3.1/leaflet.css'
    ],
    loaded: function() {
        if($ && L) {
            $(document.body).html('All resource loaded.');
        }
    }
});

```

## Config Options

|Params|Type|Note|
|-|-|-|
|config|Object|config path.|
|config.path|Object|key-value, Key is a reference and value is the actual reference path.|
|libs|Array|Depending on the library script list, the value is key + ":" + dependency library file defined in config.path.|
|styles|Array|Depending on the library script list, the value is key + ":" + dependency library file defined in config.path.|
|loaded|Function|Load completion callback method|

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