Skip to content

Cache and load static files from local storage.

License

Notifications You must be signed in to change notification settings

maoshuyu/bootup.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

bootup.js

Cache and load static files from local storage. This makes it easier to manage Javascript and other files for offline use, or just to improve the startup time of your web app.

How to use

Simply instantiate a new BootUp object with an array of files to load.

    new BootUp(files, options);

Where:

  • files: an array of URLs to load,
  • options: an object literal (optional)

Options

success: function(Object BootUp)

A callback for when all files have loaded successfully.

error: function(Object BootUp)

A callback for when at least one file has failed.

loaded: function(Object BootUp, Number downloadedCount, Number fileCount, String path, String data)

This callback will fired after a file has successfully downloaded.

  • downloadedCount returns the number of items that have successfully downloaded so far.
  • fileCount returns the number of files remaining.
  • path is the path of the file.
  • data is the contents of the file.

threads: Number

The maximum number of files to download at the same time. The default is 8.

debug: Boolean

Set to true to have logged console output.

refresh: Boolean

Set to true to delete the local storage cache and redownload everything.

License

This project is licensed under the LGPL, see the LICENSE.TXT file for more information.

About

Cache and load static files from local storage.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published