Skip to content
apyrkhPublic

About

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

Topics

Resources

Stars

3 stars

Watchers

2 watching

Forks

Latest commit

 

History

28 Commits

Folders and files

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

Stars

3 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages