Skip to content
/ up.js Public

A lightweight solution for loading/prefetching resources(css, js, images, etc.) in right order

License

Notifications You must be signed in to change notification settings

apyrkh/up.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

up.js

up.js allows to load, prefetch and import css, js, images and etc. on demand in right order.

How to use

Download up.js manually or install via npm

npm install -S up.js

Load scripts and apply them in right order

up
  .js('path/to/your/script1.js', function() { console.log('script1 loaded') })
  .js('path/to/your/script2.js')
  .js('path/to/your/script3.js', function() { console.log('script3 loaded') })

Load styles

up
  .link('path/to/your/styles1.css', 'stylesheet')
  .link('path/to/your/styles2.css', 'stylesheet')
  .link('path/to/your/styles3.css', 'stylesheet')

Prefetch resources

up
  .link('path/to/your/resource.css', 'prefetch')
  .link('path/to/your/resource.js', 'prefetch')
  .link('path/to/your/resource.png', 'prefetch')

Import resources

up
  .link('path/to/your/file1.html', 'import')
  .link('path/to/your/file2.html', 'import')
  .link('path/to/your/file3.html', 'import')
  • Copyright (c) 2015 Aliaksandr Pyrkh
  • License: MIT

About

A lightweight solution for loading/prefetching resources(css, js, images, etc.) in right order

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published