{"name":"load-script","description":"Dynamic script loading","version":"0.0.2","keywords":["script","load"],"license":"MIT","component":{"scripts":{"load-script/index.js":"index.js"}},"_id":"load-script@0.0.2","dist":{"shasum":"81d771718ac6c56e4f7733178550ab29f972c201","tarball":"http://registry-npm.ywwl.com/load-script/download/load-script-0.0.2.tgz","integrity":"sha512-Fu2LGaVXbMGHwlXOontefJMWreoc90KV9ruSfl2yZQg32qT7b9KsqatHveNMTrci65a4Qe8eqa7G8iiTj4a/wQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFT4wlaH+wSlWLvIhR3OeU084DTV8s2X5eY6/UV7tELLAiAMutcp4lzKWa13PTS9X2JYsZ/cTY9HXv2MUMjoyS3a0Q=="}],"size":1454,"noattachment":false,"key":"/load-script/-/load-script-0.0.2.tgz"},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"rauchg","email":"rauchg@gmail.com"},"maintainers":[{"name":"rauchg","email":"rauchg@gmail.com"}],"directories":{},"readme":"# load-script\n\nDynamic script loading.\n\n## Installation\n\nvia component\n\n```\n$ component install eldargab/load-script\n```\n\nvia npm\n\n```\n$ npm install load-script\n```\n\n## API\n`load-script` appends a `script` node to the `<head>` element in the dom.\n\n`require('load-script')` returns a function of the following interface:  `function(url[, opts][, cb]) {}`\n\n### url\nAny url that you would like to load.  May be absolute or relative.\n\n### [, opts]\nA map of options.  Here are the currently supported options:\n\n* `async` - A boolean value used for `script.async`.  By default this is `true`.\n* `attrs` - A map of attributes to set on the `script` node before appending it to the DOM.  By default this is empty.\n* `charset` - A string value used for `script.charset`.  By default this is `utf8`.\n* `text` - A string of text to append to the `script` node before it is appended to the DOM.  By default this is empty.\n* `type` - A string used for `script.type`.  By default this is `text/javascript`.\n\n### [, cb]\nA callback function of the following interface: `function(err, script) {}` where `err` is an error if any occurred and `script` is the `script` node that was appended to the DOM.\n\n## Example Usage\n\n```javascript\nvar load = require('load-script')\n\nload('foo.js', function (err, script) {\n  if (err) {\n    // print useful message\n  }\n  else {\n    console.log(script.src);// Prints 'foo'.js'\n    // use script\n    // note that in IE8 and below loading error wouldn't be reported\n  }\n})\n```\n\n## License\n\nMIT\n","publish_time":1369786128399,"_cnpm_publish_time":1369786128399,"dist-tags":{"latest":"2.0.0"}}