(function (global, factory) {
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('path')) :
  typeof define === 'function' && define.amd ? define(['exports', 'path'], factory) :
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.npm = {}, global.path));
})(this, (function (exports, path) { 'use strict';

  function getPkgVersion() {
    const version = process.env.npm_package_version;
    if (!version) {
      try {
        return require(path.resolve("package.json")).version;
      } catch {
      }
    }
    return version;
  }

  exports.getPkgVersion = getPkgVersion;

  Object.defineProperty(exports, '__esModule', { value: true });

}));
