{"_id":"react-load-script","_rev":"19-caa6039d60d482773c4df476baec0c74","name":"react-load-script","description":"react-load-script enables you to easily create components which depend on third party JS scripts","dist-tags":{"latest":"0.0.6"},"versions":{"0.0.1":{"name":"react-load-script","version":"0.0.1","description":"react-load-script enables you to easily create components which depend on third party JS scripts","main":"lib/index.js","author":{"name":"Blueberry"},"repository":{"type":"git","url":"git+https://github.com/blueberryapps/react-load-script.git"},"scripts":{"build":"npm run build:lib","build:lib":"babel src --out-dir lib","clean":"rimraf lib"},"keywords":["react","script"],"license":"MIT","devDependencies":{"babel-cli":"^6.7.0","babel-core":"^6.7.0","babel-eslint":"^6.0.0","babel-plugin-add-module-exports":"^0.1.2","babel-plugin-transform-runtime":"^6.6.0","babel-preset-es2015":"^6.6.0","babel-preset-react":"^6.5.0","babel-preset-stage-0":"^6.5.0","eslint":"^2.9.0","eslint-config-airbnb":"^8.0.0","eslint-plugin-import":"^1.0.3","eslint-plugin-jsx-a11y":"^1.0.4","eslint-plugin-react":"^5.0.1","rimraf":"^2.4.3"},"dependencies":{"react":">=0.14.2"},"gitHead":"d3baf7a74733e8f9b4bb2a56925e0c2418c2ff7a","bugs":{"url":"https://github.com/blueberryapps/react-load-script/issues"},"homepage":"https://github.com/blueberryapps/react-load-script#readme","_id":"react-load-script@0.0.1","_shasum":"56427e06751176ca03b9f546b734bc68af825def","_from":".","_npmVersion":"3.8.1","_nodeVersion":"5.8.0","_npmUser":{"name":"jkottnauer","email":"jk@jakubkottnauer.com"},"dist":{"shasum":"56427e06751176ca03b9f546b734bc68af825def","tarball":"https://registry.npmjs.org/react-load-script/-/react-load-script-0.0.1.tgz","integrity":"sha512-qFk+Uqnr0LF2gDLr6Qo0PKbmN8MFU8kuhXQDk+pXEkmSyGsNjRuclSG2D9rOFpObdAdmDzupsOUmchDEczUkaQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAiuDOlaObGvTf8dRXfzq/Wm10Jo4NBVxGEpGzgYVtBuAiBFE/7Wewv95x5jHckX/s0jy7SwpuEqMZkiNWEGGw2S5A=="}]},"maintainers":[{"name":"jkottnauer","email":"jk@jakubkottnauer.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/react-load-script-0.0.1.tgz_1463579683284_0.017058642813935876"},"deprecated":"abandoned and unmaintained","directories":{}},"0.0.2":{"name":"react-load-script","version":"0.0.2","description":"react-load-script enables you to easily create components which depend on third party JS scripts","main":"lib/index.js","author":{"name":"Blueberry"},"repository":{"type":"git","url":"git+https://github.com/blueberryapps/react-load-script.git"},"scripts":{"build":"npm run build:lib","build:lib":"babel src --out-dir lib","clean":"rimraf lib"},"keywords":["react","script"],"license":"MIT","devDependencies":{"babel-cli":"^6.7.0","babel-core":"^6.7.0","babel-eslint":"^6.0.0","babel-plugin-add-module-exports":"^0.1.2","babel-plugin-transform-runtime":"^6.6.0","babel-preset-es2015":"^6.6.0","babel-preset-react":"^6.5.0","babel-preset-stage-0":"^6.5.0","eslint":"^2.9.0","eslint-config-airbnb":"^8.0.0","eslint-plugin-import":"^1.0.3","eslint-plugin-jsx-a11y":"^1.0.4","eslint-plugin-react":"^5.0.1","rimraf":"^2.4.3"},"dependencies":{"react":">=0.14.2"},"gitHead":"d3baf7a74733e8f9b4bb2a56925e0c2418c2ff7a","bugs":{"url":"https://github.com/blueberryapps/react-load-script/issues"},"homepage":"https://github.com/blueberryapps/react-load-script#readme","_id":"react-load-script@0.0.2","_shasum":"591682d7ddac6061684e1d37fe7f4236dab64053","_from":".","_npmVersion":"3.8.1","_nodeVersion":"5.8.0","_npmUser":{"name":"jkottnauer","email":"jk@jakubkottnauer.com"},"dist":{"shasum":"591682d7ddac6061684e1d37fe7f4236dab64053","tarball":"https://registry.npmjs.org/react-load-script/-/react-load-script-0.0.2.tgz","integrity":"sha512-icQRLAbF/ZPaTo5XtbkL7pIAsXjahdpDYOKtTKzXPogFdZTi/1deW42LggxrrgPzoO8L6zevEFj2iTE/yHpg0g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRh0uNNzZp5/XeMshaeIGB6B+l6Th1lHYOUwMLb6F11AIgRHUE6qeRrudIejrPEa5B5JCWjHe0ArryHZmekoZzDlE="}]},"maintainers":[{"name":"jkottnauer","email":"jk@jakubkottnauer.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/react-load-script-0.0.2.tgz_1463942850079_0.9778214718680829"},"directories":{},"deprecated":"abandoned and unmaintained"},"0.0.3":{"name":"react-load-script","version":"0.0.3","description":"react-load-script enables you to easily create components which depend on third party JS scripts","main":"lib/index.js","author":{"name":"Blueberry"},"repository":{"type":"git","url":"git+https://github.com/blueberryapps/react-load-script.git"},"scripts":{"build":"npm run build:lib","build:lib":"babel src --out-dir lib","clean":"rimraf lib"},"keywords":["react","script"],"license":"MIT","devDependencies":{"babel-cli":"^6.7.0","babel-core":"^6.7.0","babel-eslint":"^6.0.0","babel-plugin-add-module-exports":"^0.1.2","babel-plugin-transform-runtime":"^6.6.0","babel-preset-es2015":"^6.6.0","babel-preset-react":"^6.5.0","babel-preset-stage-0":"^6.5.0","eslint":"^2.9.0","eslint-config-airbnb":"^8.0.0","eslint-plugin-import":"^1.0.3","eslint-plugin-jsx-a11y":"^1.0.4","eslint-plugin-react":"^5.0.1","rimraf":"^2.4.3"},"dependencies":{"prop-types":"^15.5.8","react":">=0.14.2"},"gitHead":"aa88785cec3c5ea8a7780314b0f4db221cce5afd","bugs":{"url":"https://github.com/blueberryapps/react-load-script/issues"},"homepage":"https://github.com/blueberryapps/react-load-script#readme","_id":"react-load-script@0.0.3","_shasum":"98de7648788dc22b434d78885b86a79cdb88dbda","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.9.0","_npmUser":{"name":"jkottnauer","email":"jk@jakubkottnauer.com"},"dist":{"shasum":"98de7648788dc22b434d78885b86a79cdb88dbda","tarball":"https://registry.npmjs.org/react-load-script/-/react-load-script-0.0.3.tgz","integrity":"sha512-F2AgrX0ZhHAAMZnTg66ytr7O0z11lgcvdiwyQLaBQQlu+vTLIlx6q3GnKbc3DK80XvwROmIVvqxwiQslN2FU9g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC7AwtJ+E+YZogSpyzW3AMsPbWrS4kLvm17d0/ID0LAHgIhAL0mN7RminuyvBCu7xYVT7LNCKgZ5uU+7BRdu5l1WTF1"}]},"maintainers":[{"name":"jkottnauer","email":"jk@jakubkottnauer.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/react-load-script-0.0.3.tgz_1493495177052_0.36280912905931473"},"directories":{},"deprecated":"abandoned and unmaintained"},"0.0.4-alpha":{"name":"react-load-script","version":"0.0.4-alpha","description":"react-load-script enables you to easily create components which depend on third party JS scripts","main":"lib/index.js","author":{"name":"Blueberry"},"repository":{"type":"git","url":"git+https://github.com/blueberryapps/react-load-script.git"},"scripts":{"build":"npm run build:lib","build:lib":"babel src --out-dir lib","clean":"rimraf lib","lint":"eslint ./src/*","test":"jest","prepublish":"npm run lint && npm run test && npm run build"},"keywords":["react","script"],"jest":{"rootDir":"src"},"license":"MIT","devDependencies":{"babel-cli":"6.24.1","babel-core":"6.24.1","babel-eslint":"7.2.3","babel-plugin-add-module-exports":"0.1.2","babel-plugin-transform-runtime":"6.6.0","babel-preset-es2015":"6.6.0","babel-preset-react":"6.5.0","babel-preset-stage-1":"6.24.1","enzyme":"2.8.2","eslint":"3.19.0","eslint-config-airbnb":"14.1.0","eslint-plugin-import":"2.2.0","eslint-plugin-jsx-a11y":"4.0.0","eslint-plugin-react":"6.10.3","jest":"19.0.2","prop-types":"15.5.8","react":"15.5.4","react-addons-test-utils":"15.5.1","react-dom":"15.5.4","rimraf":"2.4.3"},"dependencies":{},"peerDependencies":{"react":">=0.14.9","prop-types":">=15"},"gitHead":"840ea8df836ba4b5771df18d05e3256fd3cc81da","bugs":{"url":"https://github.com/blueberryapps/react-load-script/issues"},"homepage":"https://github.com/blueberryapps/react-load-script#readme","_id":"react-load-script@0.0.4-alpha","_shasum":"fc59aabfcf2987f467d73cf597961cfcebe7388d","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"jkottnauer","email":"jk@jakubkottnauer.com"},"dist":{"shasum":"fc59aabfcf2987f467d73cf597961cfcebe7388d","tarball":"https://registry.npmjs.org/react-load-script/-/react-load-script-0.0.4-alpha.tgz","integrity":"sha512-QIuy5LIjpesThDWpZWZXg8g/uQT7eS4BRa5eNSNiUYKRDMf1SxjDozKI3VZCNlyGeSxxH/AWwv7jHMHt8aB04A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCDqvfiVIJWVSyhZpOu8FXtSV7WJAL7WOCq3ifDBrw31QIgVdknwugmnL+RjkfQumYptL7xEhVrm7etlcwFVZu2T4w="}]},"maintainers":[{"name":"jkottnauer","email":"jk@jakubkottnauer.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-load-script-0.0.4-alpha.tgz_1496133990415_0.38574102823622525"},"directories":{}},"0.0.4":{"name":"react-load-script","version":"0.0.4","description":"react-load-script enables you to easily create components which depend on third party JS scripts","main":"lib/index.js","author":{"name":"Blueberry"},"repository":{"type":"git","url":"git+https://github.com/blueberryapps/react-load-script.git"},"scripts":{"build":"npm run build:lib","build:lib":"babel src --out-dir lib","clean":"rimraf lib","lint":"eslint ./src/*","test":"jest","prepublish":"npm run lint && npm run test && npm run build"},"keywords":["react","script"],"jest":{"rootDir":"src"},"license":"MIT","devDependencies":{"babel-cli":"6.24.1","babel-core":"6.24.1","babel-eslint":"7.2.3","babel-plugin-add-module-exports":"0.1.2","babel-plugin-transform-runtime":"6.6.0","babel-preset-es2015":"6.6.0","babel-preset-react":"6.5.0","babel-preset-stage-1":"6.24.1","enzyme":"2.8.2","eslint":"3.19.0","eslint-config-airbnb":"14.1.0","eslint-plugin-import":"2.2.0","eslint-plugin-jsx-a11y":"4.0.0","eslint-plugin-react":"6.10.3","jest":"19.0.2","prop-types":"15.5.8","react":"15.5.4","react-addons-test-utils":"15.5.1","react-dom":"15.5.4","rimraf":"2.4.3"},"dependencies":{},"peerDependencies":{"react":">=0.14.9","prop-types":">=15"},"gitHead":"476e80f02184fa5fcd558c039b4f69a8e6f4de06","bugs":{"url":"https://github.com/blueberryapps/react-load-script/issues"},"homepage":"https://github.com/blueberryapps/react-load-script#readme","_id":"react-load-script@0.0.4","_shasum":"54175cb9037e3f21b979c858dbd25cbad4eb1139","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"jkottnauer","email":"jk@jakubkottnauer.com"},"dist":{"shasum":"54175cb9037e3f21b979c858dbd25cbad4eb1139","tarball":"https://registry.npmjs.org/react-load-script/-/react-load-script-0.0.4.tgz","integrity":"sha512-0YI8p7FvtrTPd4WrRmoDpKJihBk6aWvC03F7WPJsQGtsBcGfQWJI4d1Ri7zQpxjiV6XJ8y5OGsiyasaxM2xLTg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIATXUnEM3pxUAGr4T9loi7TRNA9Qd+ITvo1rdmIlj8mkAiB5N2Pi0B8dRwK48USNUZhLrB2Xgz28QLbiPTWOKYI59w=="}]},"maintainers":[{"name":"jkottnauer","email":"jk@jakubkottnauer.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-load-script-0.0.4.tgz_1496134795368_0.08123662089928985"},"directories":{},"deprecated":"abandoned and unmaintained"},"0.0.5":{"name":"react-load-script","version":"0.0.5","description":"react-load-script enables you to easily create components which depend on third party JS scripts","main":"lib/index.js","author":{"name":"Blueberry"},"repository":{"type":"git","url":"git+https://github.com/blueberryapps/react-load-script.git"},"scripts":{"build":"npm run build:lib","build:lib":"babel src --out-dir lib","clean":"rimraf lib","lint":"eslint ./src/*","test":"jest","prepublish":"yarn lint && yarn test && yarn build"},"keywords":["react","script"],"jest":{"rootDir":"src"},"license":"MIT","devDependencies":{"babel-cli":"6.24.1","babel-core":"6.24.1","babel-eslint":"7.2.3","babel-plugin-add-module-exports":"0.1.2","babel-plugin-transform-runtime":"6.6.0","babel-preset-es2015":"6.6.0","babel-preset-react":"6.5.0","babel-preset-stage-1":"6.24.1","enzyme":"2.8.2","eslint":"3.19.0","eslint-config-airbnb":"14.1.0","eslint-plugin-import":"2.2.0","eslint-plugin-jsx-a11y":"4.0.0","eslint-plugin-react":"6.10.3","jest":"19.0.2","prop-types":"15.5.8","react":"15.5.4","react-addons-test-utils":"15.5.1","react-dom":"15.5.4","rimraf":"2.4.3"},"dependencies":{},"peerDependencies":{"prop-types":">=15","react":">=0.14.9"},"gitHead":"90c9b1ab06a94bf87c850309254505dabf7c97e0","bugs":{"url":"https://github.com/blueberryapps/react-load-script/issues"},"homepage":"https://github.com/blueberryapps/react-load-script#readme","_id":"react-load-script@0.0.5","_npmVersion":"5.0.3","_nodeVersion":"8.1.3","_npmUser":{"name":"jkottnauer","email":"jk@jakubkottnauer.com"},"dist":{"integrity":"sha512-OJKbZWeGoeQ7UrHuNKJVz1HkkX/Ir3lvg1t+72BTNrkLF2XRecOJq/ZI+w5LcayyQfV64vsnRS0Fw1wi1nSHPQ==","shasum":"f1020db40f3ac134c37f9974bba77c96e11965a4","tarball":"https://registry.npmjs.org/react-load-script/-/react-load-script-0.0.5.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDPpKdUDAXkE/JCoAddQflyxD6K2ENccMtcYPd5OxNUbAiBuYWPJ2Nww84wPDL/mGnH0X7bZQt0NPHSLFZoc0qok2Q=="}]},"maintainers":[{"name":"jkottnauer","email":"jk@jakubkottnauer.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-load-script-0.0.5.tgz_1499626788309_0.34795210836455226"},"directories":{},"deprecated":"abandoned and unmaintained"},"0.0.6":{"name":"react-load-script","version":"0.0.6","description":"react-load-script enables you to easily create components which depend on third party JS scripts","main":"lib/index.js","author":{"name":"Blueberry"},"repository":{"type":"git","url":"git+https://github.com/blueberryapps/react-load-script.git"},"scripts":{"build":"npm run build:lib","build:lib":"babel src --out-dir lib","clean":"rimraf lib","lint":"eslint ./src/*","test":"jest","prepublish":"yarn lint && yarn test && yarn build"},"keywords":["react","script"],"jest":{"rootDir":"src"},"license":"MIT","devDependencies":{"babel-cli":"6.24.1","babel-core":"6.24.1","babel-eslint":"7.2.3","babel-plugin-add-module-exports":"0.1.2","babel-plugin-transform-runtime":"6.6.0","babel-preset-es2015":"6.6.0","babel-preset-react":"6.5.0","babel-preset-stage-1":"6.24.1","enzyme":"2.8.2","eslint":"3.19.0","eslint-config-airbnb":"14.1.0","eslint-plugin-import":"2.2.0","eslint-plugin-jsx-a11y":"4.0.0","eslint-plugin-react":"6.10.3","jest":"19.0.2","prop-types":"15.5.8","react":"15.5.4","react-addons-test-utils":"15.5.1","react-dom":"15.5.4","rimraf":"2.4.3"},"dependencies":{},"peerDependencies":{"prop-types":">=15","react":">=0.14.9"},"gitHead":"995e1aec9f1e2a64d7a1706ed9f8b2c4206f20c4","bugs":{"url":"https://github.com/blueberryapps/react-load-script/issues"},"homepage":"https://github.com/blueberryapps/react-load-script#readme","_id":"react-load-script@0.0.6","_npmVersion":"5.0.3","_nodeVersion":"8.1.3","_npmUser":{"name":"jkottnauer","email":"jk@jakubkottnauer.com"},"dist":{"integrity":"sha512-aRGxDGP9VoLxcsaYvKWIW+LRrMOzz2eEcubTS4NvQPPugjk2VvMhow0wWTkSl7RxookomD1MwcP4l5UStg5ShQ==","shasum":"db6851236aaa25bb622677a2eb51dad4f8d2c258","tarball":"https://registry.npmjs.org/react-load-script/-/react-load-script-0.0.6.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG3Ksa49T/V2bz8s2MArRF7E0bWBAaRzg+gSglZmnzwYAiBibpPTbIwTYhephrBjEPqNf1vJFDAiOhwfMdyy3KEWsg=="}]},"maintainers":[{"name":"jkottnauer","email":"jk@jakubkottnauer.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-load-script-0.0.6.tgz_1499843333552_0.5091326227411628"},"directories":{},"deprecated":"abandoned and unmaintained"}},"readme":"# react-load-script [![CircleCI](https://circleci.com/gh/blueberryapps/react-load-script.svg?style=svg)](https://circleci.com/gh/blueberryapps/react-load-script) [![Dependency Status](https://dependencyci.com/github/blueberryapps/react-load-script/badge)](https://dependencyci.com/github/blueberryapps/react-load-script)\nThis package simplifies loading of 3rd party scripts in your React applications.\n\n## Motivation\nThere are situations when you need to use a 3rd party JS library in your React application (jQuery, D3.js for rendering charts, etc.) but you don't need it everywhere and/or you want to use it only in a response to users actions. In cases like this, preloading the whole library when application starts is an unnecessary and expensive operation which could possibly slow down your application.\n\nUsing the `Script` component this package provides you with, you can easily load any 3rd party scripts your applications needs directly in a relevant component and show a placeholder while the script is loading (e.g. a loading animation). As soon as the script is fully loaded, a callback function you'll have passed to `Script` is called (see example below).\n\n## Supported React versions\nThis package requires React 0.14.9 and higher.\n\n## API\nThe package exports a single component with the following props:\n\n### `onCreate`\nCalled as soon as the script tag is created.\n\n### `onError` (required)\nCalled in case of an error with the script.\n\n### `onLoad` (required)\nCalled when the requested script is fully loaded.\n\n### `url` (required)\nURL pointing to the script you want to load.\n\n### `attributes`\nAn object used to define custom attributes to be set on the script element. For example, `attributes={{ id: 'someId', 'data-custom: 'value' }}` will result in `<script id=\"someId\" data-custom=\"value\" />`\n\n## Example\nYou can use the following code to load jQuery in your app:\n\n```jsx\nimport Script from 'react-load-script'\n\n...\n\nrender() {\n  return (\n    <Script\n      url=\"https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js\"\n      onCreate={this.handleScriptCreate.bind(this)}\n      onError={this.handleScriptError.bind(this)}\n      onLoad={this.handleScriptLoad.bind(this)}\n    />\n  )\n}\n\n...\n\nhandleScriptCreate() {\n  this.setState({ scriptLoaded: false })\n}\n\nhandleScriptError() {\n  this.setState({ scriptError: true })\n}\n\nhandleScriptLoad() {\n  this.setState({ scriptLoaded: true })\n}\n\n```\n\n## License\nMIT 2016\n\n## Made with love by\n[![](https://camo.githubusercontent.com/d88ee6842f3ff2be96d11488aa0d878793aa67cd/68747470733a2f2f7777772e676f6f676c652e636f6d2f612f626c75656265727279617070732e636f6d2f696d616765732f6c6f676f2e676966)](https://www.blueberry.io)\n","maintainers":[{"name":"jkottnauer","email":"jk@jakubkottnauer.com"}],"time":{"modified":"2022-06-26T01:18:38.080Z","created":"2016-05-18T13:54:45.479Z","0.0.1":"2016-05-18T13:54:45.479Z","0.0.2":"2016-05-22T18:47:32.510Z","0.0.3":"2017-04-29T19:46:17.768Z","0.0.4-alpha":"2017-05-30T08:46:31.496Z","0.0.4":"2017-05-30T08:59:56.428Z","0.0.5":"2017-07-09T18:59:49.434Z","0.0.6":"2017-07-12T07:08:54.679Z"},"homepage":"https://github.com/blueberryapps/react-load-script#readme","keywords":["react","script"],"repository":{"type":"git","url":"git+https://github.com/blueberryapps/react-load-script.git"},"author":{"name":"Blueberry"},"bugs":{"url":"https://github.com/blueberryapps/react-load-script/issues"},"license":"MIT","readmeFilename":"README.md","users":{"zuizuihao":true,"actionwolf":true,"yuki070":true,"sanzhar.dan":true,"orenschwartz":true,"5tormtrooper":true,"eijs":true}}