0.3.2 • Published 10 years ago

bucketjs v0.3.2

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

Installation

$ npm install bucketjs

Example

On server:

var bucket = require('bucketjs');

nodeJsServerResponse(200, '<html><head><script>' + bucket.src + '</script></head><body>OK</body></html>');

On client:

bucket.require('/static/fa284b8114ff6ecc5e73.js', { key: 'commons.js', version: 'fa284b8114ff6ecc5e73'});

require Api

bucket.require(resourceUrl, options, doneCallback);

Accepts the following options:

  • {String} key - Unique resource key, default is resource.
  • {String} version - Unique tag for invalidate cache, default is null.
  • {Number} expire - Expiration time in ms if 0 than infinity, default is 0.
  • {Number} timeout - Request timeout in ms, default is 5000.
  • {Boolean} sync - Load resource sync, default is false.
  • {Boolean} defer - Add defer to script, default is false.
  • {Boolean} bottom - Append script to body, default is false.
  • {Boolean} link - Classic load as link for css and with src for script, default is false.
  • {Array} waitFor - Append resource after resources from list.

Build for development

$ npm install gulp -g
$ npm install
$ gulp

Authors

License

MIT

0.3.2

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.0

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.1

11 years ago