🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

taxi.js

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

taxi.js

A javascript loader for loading client side bundles on demand.

latest
Source
npmnpm
Version
0.3.5
Version published
Maintainers
1
Created
Source

taxi.js NPM version devDependency Status

browser support

Loads javascript bundles on demand or on click. Bundles are combined files of javascript code you would generate with browserify, grunt, gulp or other build tools.

Options

{
  // path to the bundle files
  path: '/',
  // html attribute
  attr: 'data-require',
  // load automatically on Taxi()
  autoload: true,
  // store scripts in localStorage
  store: true,
  // cache scripts / if false will append timestamp as query string to script url
  cache: true,
  // prefix for localStorage objects
  storagePrefix: 'taxi-',
  // default expire time in hours (2h)
  expiration: 2,
  // invalidation string, if changed stored object will be invalidated
  cacheBuster: '',
  // either load packes with .min.js or .js
  usMin: false
}

Usage

var taxi = Taxi({
  path: '/javascript/build/'
})
.bundle(function (type, bundle, error, errorObj) {
  // type is 'loaded' or 'error'
  // bundle loaded or error
})
.done(function (loaded, failed) {
  // all bundles loaded
});
<div data-require="bundle-name"></div>

On click loading

var taxi = Taxi({
  path: '/javascript/build/'
});

taxi.onclick(selector, 'bundle-name', loadEnd, loadStart);

Analytics

Keywords

file

FAQs

Package last updated on 09 Jun 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts