0.3.2 • Published 9 years ago

bucketjs v0.3.2

Weekly downloads
3
License
MIT
Repository
github
Last release
9 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

9 years ago

0.3.1

9 years ago

0.3.0

9 years ago

0.2.0

9 years ago

0.1.3

9 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.1

10 years ago