Skip to content

Latest commit

 

History

History
55 lines (36 loc) · 894 Bytes

README.md

File metadata and controls

55 lines (36 loc) · 894 Bytes

getCurrentScript

Get the currently executing script in the browser.

demo

See simple demo.

bower

bower install --save get-current-script

npm

npm install --save get-current-script

usage

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.