{"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":"http://registry-npm.ywwl.com/@soda/get-current-script/download/@soda/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"}],"size":5342,"noattachment":false,"key":"/@soda/get-current-script/-/@soda/get-current-script-1.0.2.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.2_1592273055284_0.6660725152795723"},"_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":1592273055387,"_cnpm_publish_time":1592273055387,"dist-tags":{"latest":"1.0.2"}}