{"name":"load-script","description":"Dynamic script loading for browser","version":"2.0.0","types":"./index.d.ts","keywords":["browser","script","load"],"repository":{"type":"git","url":"git://github.com/eldargab/load-script.git"},"scripts":{"test":"zuul -- test/index.js","test-local":"zuul --local 9005 -- test/index.js"},"devDependencies":{"zuul":"~2.1.0"},"license":"MIT","gitHead":"a282a018699997b89cf24ab0d1fe1f7b99dab612","bugs":{"url":"https://github.com/eldargab/load-script/issues"},"homepage":"https://github.com/eldargab/load-script#readme","_id":"load-script@2.0.0","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-km6cyoPW4rM22JMGb+SHUKPMZVDpUaMpMAKrv8UHWllIxc/qjgMGHD91nY+5hM+/NFs310OZ2pqQeJKs7HqWPA==","shasum":"40821aaa59e9bbe7be2e28b6ab053e6f44330fa1","tarball":"http://registry-npm.ywwl.com/load-script/download/load-script-2.0.0.tgz","fileCount":10,"unpackedSize":6647,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2yLKCRA9TVsSAnZWagAAepsQAImX84LzwqPmcGP/bfl7\nYDLm2jocR8mjmx1UBISjSTiTz9bFEbD+o57dBYd9Jyjk/id5HAK19FOyoPNU\nKux8TKyLLIez/+MC28QNmh/72Vt3zaILUN+R+r3HWV4arOgQc6E1YHsQQy5N\n/20R/ntJsQ08aL5GZW/aaO+7KejhiHirSl4LITywKxep9am5T3gDBIjuiH9v\nHvlyT9Gh1HbLtOiUal9rlpsucr9tulz+iH3vhFK9MulR71+osGDY3Dprpdzz\nYmZWdONP5eC/9+fVSoqTtMxvRvqIBkA7xxcQD/INiytMpyzi8icxjiE33uKX\nvsw/oFb39dykgX4W/72bgmliYenb3ffqmTgtF8r5TWT258BoyaIEpHQHJWoB\nKKGtWhiVD9B0y1Lr2jd5i06sf+FqOW/R8YIeV8bVB3ciLjON5t+kiihSbZkc\ngpULno/8IDsNEToU0Pm2EGXBjc7PpreASGHqOQ1UyW9QWAi6JJ/86Lwjyn2z\nCpxa1Q7NQ4R8M+HHxIhYpWJfQCx1CU7E0MHw6KAZcIjpkw9WMwIfM2lRXpT+\nVmI/lWQ5AqPh101E9BhfzbGUUliRYf+MxS2L+XJizKZLkz6NDGrTGAL5XrYv\nVACij6/imSX6wC4vC+OGc+I5OxDX5BW3QNd3FwFIKofYv04/zkrhjPpMgVi/\nep1U\r\n=e0lB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8yQ953ro95+MqsPNa33dN86tj6KWPp3mKUIeJTnQ7bQIgFi+yd+6BHecr3ciycYAsX1qqtwe+OsMfSyrvdAdNVVs="}],"size":2691,"noattachment":false,"key":"/load-script/-/load-script-2.0.0.tgz"},"_npmUser":{"name":"eldar","email":"eldargab@gmail.com"},"directories":{},"maintainers":[{"name":"eldar","email":"eldargab@gmail.com"},{"name":"rauchg","email":"rauchg@gmail.com"},{"name":"defunctzombie","email":"shtylman@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/load-script_2.0.0_1633552535503_0.963853819115956"},"_hasShrinkwrap":false,"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":1633552535646,"_cnpm_publish_time":1633552535646,"dist-tags":{"latest":"2.0.0"}}