{"_id":"@soda/get-current-script","_rev":"3-db4c02be0800841239a32a93871d3701","name":"@soda/get-current-script","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"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":"https://registry.npmjs.org/@soda/get-current-script/-/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=="}]},"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},"1.0.1":{"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":"https://registry.npmjs.org/@soda/get-current-script/-/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"}]},"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},"1.0.2":{"name":"@soda/get-current-script","version":"1.0.2","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":"79e86ee8ef8db24209f95750a88634e311d0a08b","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.2","_nodeVersion":"12.17.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-T7VNNlYVM1SgQ+VsMYhnDkcGmWhQdL0bDyGm5TlQ3GBXnJscEClUUOKduWTmm2zCnvNLC1hc3JpuXjs/nFOc5w==","shasum":"a53515db25d8038374381b73af20bb4f2e508d87","tarball":"https://registry.npmjs.org/@soda/get-current-script/-/get-current-script-1.0.2.tgz","fileCount":14,"unpackedSize":14528,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6CifCRA9TVsSAnZWagAA9hAP/2cfzA2T7IhC3nJsKZGo\nly3KCe08ZJVwEmh6pNiQB+/nLSAp6fnqo5x4Sc774UYqVUR7Wh7El4ubzppD\nw71RU3cZW1r0j6SrGxcWFFEeXIcCLrG2IgM2Ga3v8cjc9UQ72TaWgWAUaoPc\nlj7ebXcmNuIurvi1Se16ECvRslEZepbmKv00oagDYL1y4FuYDKnhBLkbzZ9n\nCEgUWuHEirHg1kFCoypVghTxoUxNcRpP9MsITy/7aIhbYwcGE/67HCyq+S6k\nv0G2lhdDoJEhjY0FUg6EaBaXGN2ze4y9TFwreb9gbwcg5wLYBVgmYzouHJIZ\nlfaf3xhu0c3WyNz+NBU9D02ySkWKDrpxsbfH4a3VipHKQ1Ck58OkrGi7cDMQ\nKGnLAn8sWcJcMjvYs4ce4HwHaqCEbxHVte/4EgW7bl08AjScOGJarfR9LsD/\nxDes8fxlux54ED7swhQSEp8ZosSMy+uXeFXOPaP0TfPdFHJTY24XPcr0bfdh\nvu59ZLVc+Fq/DINYZz1uATNmuIDmz4E4gVxWrCxWcxQLhSD+Nc7LuuKEww9x\ncsoGkkZWwGySdZVWb3Tktkidczz8Ly1CGtusmtTnyyYJkpEDm39eHEG8ZW08\neTqCt6XNZpqI6U+y5A4S/vvQNlv21FtCCvcBAmepmrSBghpskchd+azl86kk\nlvRG\r\n=uZKf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDX/mlJMifdyGS83TMCs9507Iu33/ZBV+OBp1VPC1WiwAIhAMbwMiDLvkAKt7xmloH7XXh63xG83dKHk3PSWvyuF/GS"}]},"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.2_1592273055284_0.6660725152795723"},"_hasShrinkwrap":false}},"time":{"created":"2020-03-09T07:48:59.749Z","1.0.0":"2020-03-09T07:49:00.198Z","modified":"2022-04-07T01:07:11.259Z","1.0.1":"2020-06-04T14:46:29.354Z","1.0.2":"2020-06-16T02:04:15.387Z"},"maintainers":[{"name":"soda","email":"haoqunjiang+npm@gmail.com"}],"description":"get the current executing script, with polyfills for IE9+ and Firefox","homepage":"https://github.com/sodatea/get-current-script#readme","repository":{"type":"git","url":"git+https://github.com/sodatea/get-current-script.git"},"author":{"name":"Haoqun Jiang"},"bugs":{"url":"https://github.com/sodatea/get-current-script/issues"},"license":"MIT","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","readmeFilename":"README.md"}