Skip to content

chenjiahan/proom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);
}

About

cache script with localStorage

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published