proom
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

proom

A tiny library to cache script with localStorage

Usage

<script src="proom.js"></script>

Demo

// single file
proom.init({
    prefix: 'project_',
    version: '1.0.0'
}).load({
    index: {
        url: './index.js'
    }
})
 
// multi files
// load vendor before index
proom.init({
    prefix: 'project_',
    version: '1.0.1'
}).load({
    vendor: {
        url: './vendor.js',
        onLoad: onLoad
    },
    index: {
        url: './index.js',
        onLoad: onLoad
    }
})
 
var onLoad = function () {
    var files = ['vendor', 'index'];
    proom.has(files) && proom.inject(files);
}

/proom/

    Package Sidebar

    Install

    npm i proom

    Weekly Downloads

    0

    Version

    1.2.1

    License

    ISC

    Last publish

    Collaborators

    • chenjiahan
    • niksun
    • zsky