{"name":"@soda/get-current-script","version":"1.0.0","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":"^80.0.1","geckodriver":"^1.19.1","iedriver":"^3.14.1","nightwatch":"^1.3.4","selenium-server":"^3.141.59","serve":"^11.3.0","start-server-and-test":"^1.10.8"},"publishConfig":{"access":"public"},"gitHead":"c308b2fe04b823e8e1acb0ac5e7b7af4add68b39","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.0","_nodeVersion":"12.16.1","_npmVersion":"6.14.0","dist":{"integrity":"sha512-9GvTek+7cVw7r+L7TNGOG1astZJWXz2h5q4BqMXl28KN+24iSCm1xo+RhZOZvwdT3bzNe9hD7riJc/lBoO7mgg==","shasum":"623aa40623550e3b94767cffeb096a6fb597ed09","tarball":"http://registry-npm.ywwl.com/@soda/get-current-script/download/@soda/get-current-script-1.0.0.tgz","fileCount":12,"unpackedSize":13459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZfTsCRA9TVsSAnZWagAA7xIQAJTte/KUWvs7MSe/Rx1Q\nVRM9T+p21zIfDyOCyyKJJmis2PJr5YggbkQz1lM7hPbzG8RcnZu5ccZXqyak\nsbj4JX8lShBqN0w4UzoogOAUjY/Rov0824qgSTo39qyUUI71e4OeNY9ESGR2\nOpUWoqmQNPH+cmR5/6sPKKt2vICoA59eLJUHUUuCWNbYNx+aCJE5V6arU1Fa\nHyNkqnwk2CkLe2adWDkuUBHmy15320KR/hE5KtXwavphFLpFmuTiaTy0lD/s\nWsSBkicbL+l+9+hTMFrtRbRqZvev7qk7ijd0FcUfcxsA+LxFXr9NDDThv8J5\nvfCL8WG3NkJPVrAXDPagoDeKnnc9NifcMeVplgYcQ4zBJgh0qVCE2nTjIiSi\n+7hE1yzQq4MT2bSTlhkbCFkA7+D8rvYKA9UDqPaOA+99f73asjhHu4MiIA8+\nUJIRYq/6KMcUqOZEbjn3oHyv7JmZFbBYgRXVO4YoPHEvZ/9xOea3q0ZM0SBK\nzxnFELJ0l8Qpyat11GmCBLGoQwhcTYToOIAn7TnSlEg71cFS30RbLEpU9iql\nnfl4Z8dUCJvb5SzqZiKtgYo/vbddUKGTpGooBU1JNfoQegtber8lkGQYvpad\nT5sKaYKk4oUQMv4z55K95u2OtVCEL3cFBbUo6P3FMBpUGsRE8bXbtYkASS6T\n2ksF\r\n=3xvP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGZKtq7EzoBi4BORvUpcxhOWlUIhNplI9p/o+Qkw7gZ0AiBIkUGiyjE3FnoJplucZbzHiGjVo67q5C2fs/rJATaBpw=="}],"size":5109,"noattachment":false,"key":"/@soda/get-current-script/-/@soda/get-current-script-1.0.0.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.0_1583740139984_0.3337941287485322"},"_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":1583740140198,"_cnpm_publish_time":1583740140198,"dist-tags":{"latest":"1.0.2"}}