web-assets-manager

2.0.1 • Public • Published

web-assets-manager

code style: prettier Dependency Status DevDependency Status Travis Build Status NPM Downloads

Manager for web assets.

Install

$ npm install web-assets-manager

Usage

// wam is a singletone
import wam from 'web-assets-manager';

const assets = {
  logo: 'https://cdn.example.com/logo.png',
  bg: 'https://cdn.example.com/bg.jpg',
  // ...
};

// setup assets
wam.setup(assets);

// preload assets
wam.preload(
  function onProgress(currentProgress) {
    console.log(currentProgress);
  },
  function onComplete() {
    console.log('complete');
  }
);

// get assets
wam.get('logo'); // 'https://cdn.example.com/logo.png'
wam.get('bg'); // 'https://cdn.example.com/bg.jpg'

Todo

  • documents about API
  • strict type checking

Readme

Keywords

none

Package Sidebar

Install

npm i web-assets-manager

Weekly Downloads

0

Version

2.0.1

License

MIT

Unpacked Size

9.8 kB

Total Files

5

Last publish

Collaborators

  • m31271n_