{"name":"@soda/get-current-script","version":"1.0.1","description":"get the current executing script, with polyfills for IE9+ and Firefox","main":"index.js","scripts":{"start":"serve .","test:chrome":"nightwatch -t test.js -e chrome","test:firefox":"nightwatch -t test.js -e firefox","test:ie":"nightwatch -t test.js -e ie","ci:chrome":"yarn start-test start http://localhost:5000 test:chrome","ci:firefox":"yarn start-test start http://localhost:5000 test:firefox","ci:ie":"yarn start-test start http://localhost:5000 test:ie","ci":"yarn ci:chrome && yarn ci:firefox && yarn ci:ie"},"repository":{"type":"git","url":"git+https://github.com/sodatea/get-current-script.git"},"author":{"name":"Haoqun Jiang"},"license":"MIT","dependencies":{},"devDependencies":{"chromedriver":"^83.0.0","geckodriver":"^1.19.1","iedriver":"^3.14.1","nightwatch":"^1.3.4","selenium-server":"^3.141.59","serve":"^11.3.1","start-server-and-test":"^1.10.8"},"publishConfig":{"access":"public"},"gitHead":"dce9792417963716521520faa00ce7ad0c33d550","bugs":{"url":"https://github.com/sodatea/get-current-script/issues"},"homepage":"https://github.com/sodatea/get-current-script#readme","_id":"@soda/get-current-script@1.0.1","_nodeVersion":"12.17.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-zeOomWIE52M9JpYXlsR3iOf7TXTTmNQHnSbqjMsQZ5phzfAenHzL/1+vQ0ZoJfagocK11LNf8vnn2JG0ufRMUQ==","shasum":"f4afffcb36e069a801d5339c90499601c47a2516","tarball":"http://registry-npm.ywwl.com/@soda/get-current-script/download/@soda/get-current-script-1.0.1.tgz","fileCount":14,"unpackedSize":14530,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2QlFCRA9TVsSAnZWagAAqyMQAKEDVMXFgB3iQX+gCVKq\n+8d5V5E4MVRlESR4rGJN2UbF6JAn5c1YvH83ABt51FksXlYUSbNQPeGPwteW\n1N6Ru3floEdJeptoV5407DBeTTqO/BqAA+DQMgyyVGVyXsuxRmllTrIjja1v\n6JfP6gS6+uQVlGsthowuUodQHKkorIcKFywh4sy87u5tc9P3WEnJPauf+a49\n3sPgWJysHwmRAEdnF3HfGAkHyKj12mYgGPyIzJ8rex6LSc5VzCm8wE6bG3wZ\nL5wIyE4YSm0lQrRu3DjhV4YM92nGxBqNUtL62B3hcs+RZJ+Bv64ZYpWuG/Cq\n7mbRobOd0Rv3MY0jlO4YKwWa8BmRXDizWonjqJcScNIeeFRIIFcA4a8SaG1m\ndfiqkWXaZLQmOat8+8IEIEZIt6DuLMctUNKNIoQ+3bogci2kfQspBBeiSUXT\nGbaXf9Ll1GWr3T0l5uDYiKjVE6PQh+2fv3+D9v9NvL+/Eah+kJt607qsftV/\nLvIqGOw+GPIa/ZYGlrZUDyclBMjoflC5BDNJzCy9QW6JQR2B46fsPJxyapdK\nO2L69qFdM9T0y5cAbeADZG3ZQmzSesBqjWlMA1ngOEF6nKLzvFHn7+xvwsxi\nCsMCcWYttEUop1eM/BjqgJbz1QLTDhWFFuSCPMrQV3xwH0NsLMQp75JzGNYo\ny0xS\r\n=GwTt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC4L51FZibN2DnzKdM8jIR8o9UySImwcj/rCplOiNaxQgIhAJ+I4onDD6X1K3vdR1Yrw31/Q6tCEUGh/4rvyMf+ElGH"}],"size":5345,"noattachment":false,"key":"/@soda/get-current-script/-/@soda/get-current-script-1.0.1.tgz"},"maintainers":[{"name":"soda","email":"haoqunjiang+npm@gmail.com"}],"_npmUser":{"name":"soda","email":"haoqunjiang+npm@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/get-current-script_1.0.1_1591281989153_0.2518003194341065"},"_hasShrinkwrap":false,"readme":"# @soda/get-current-script ![CI](https://github.com/sodatea/get-current-script/workflows/CI/badge.svg)\n\nIt is basically a function that returns `document.currentScript` but with support for IE9-11, thanks to https://github.com/amiller-gh/currentScript-polyfill.\n\nIt also works around a [Firefox issue](https://bugzilla.mozilla.org/show_bug.cgi?id=1620505) when the script is called in a microtask, which makes `document.currentScript` unusable in a webpack dynamic-imported chunk.\n\nIt is shipped as a utility function rather than a polyfill, because we can't easily tell if the `document.currentScript` is returning `null` due to the Firefox issue or because it's running in an event handler / a callback.\n\nThe implementation here may not adhere strictly to `document.currentScript` spec when called in async code or in a callback. In these situations the spec calls for `document.currentScript` to return `null`. However, for the grand majority of your `document.currentScript` needs, this utility will do the job!\n\n## Usage\n\n```sh\nnpm i @soda/get-current-script\n```\n\n```js\nconst getCurrentScript = require('@soda/get-current-script')\nconst script = getCurrentScript() // the current executing <script> element\n```\n","publish_time":1591281989354,"_cnpm_publish_time":1591281989354,"dist-tags":{"latest":"1.0.2"}}