Get the currently executing script in the browser.
See simple demo.
bower install --save get-current-script
npm install --save get-current-script
CommonJS
var currentScript = require('get-current-script')();
NOTE: This module is intended for use in the browser.
AMD
This library is published as UMD format, so theoretically it can be done. If you figure it out, please submit a pull request. You'll be famous!
Global (Boo, hiss!)
index.html
<script src="bower_components/get-current-script/dist/getCurrentScript.js"></script>
script.js
var currentScript = getCurrentScript();
NOTE: Please, for the sake of the future, consider using a module loader of some kind.