{"name":"load-script","description":"Dynamic script loading for browser","version":"0.0.5","keywords":["browser","script","load"],"repository":{"type":"git","url":"git://github.com/eldargab/load-script"},"scripts":{"test":"zuul -- test/index.js","test-local":"zuul --local 9005 -- test/index.js"},"devDependencies":{"zuul":"~1.5.4"},"license":"MIT","bugs":{"url":"https://github.com/eldargab/load-script/issues"},"homepage":"https://github.com/eldargab/load-script","_id":"load-script@0.0.5","dist":{"shasum":"cbd54b27cd7309902b749640c70e996f4c643b63","tarball":"http://registry-npm.ywwl.com/load-script/download/load-script-0.0.5.tgz","integrity":"sha512-HV30RRVjAvC6mbSe4eCIFeZ3T79uOHQE1/xuGKbuwLW1hVRJMjryecj7P9FaOdt+iTWQ9Jwdz8MgZhXunATmcA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA1c4/kOaMsy/HoAnOXhl4KlRFrRcByer5/Gh6GBsOA5AiASawMcPIK5zDdb8CgaO4nJ7WXyENyB6M97uLRvb38ovA=="}],"size":1887,"noattachment":false,"key":"/load-script/-/load-script-0.0.5.tgz"},"_from":".","_npmVersion":"1.4.4","_npmUser":{"name":"shtylman","email":"shtylman@gmail.com"},"maintainers":[{"name":"rauchg","email":"rauchg@gmail.com"},{"name":"shtylman","email":"shtylman@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":1395366268017,"_cnpm_publish_time":1395366268017,"dist-tags":{"latest":"2.0.0"}}