JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 231595
  • Score
    100M100P100Q156079F
  • License MIT

@substack's caller.js as a module

Package Exports

  • caller

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (caller) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

caller

Figure out your caller (thanks to @substack).

Initialization Time Caller
// foo.js

var bar = require('bar');
// bar.js

var caller = require('caller');
console.log(caller()); // `/path/to/foo.js`
Runtime Caller
// foo.js

var bar = require('bar');
bar.doWork();
// bar.js

var caller = require('caller');

exports.doWork = function () {
    console.log(caller());  // `/path/to/foo.js`
};