whatap 0.5.6 → 0.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,19 +6,23 @@
6
6
 
7
7
  var fs = require('fs'),
8
8
  path = require('path');
9
+ const { execSync } = require('child_process');
9
10
 
10
- function getPackageJson(){
11
- var appDir = require('./../conf/configure')['app.root'];
11
+ function getPackageJson() {
12
12
  try {
13
- var whatap_path = path.join(
14
- appDir,
15
- 'node_modules',
16
- 'whatap',
17
- 'package.json');
18
- NodeUtil.packageJson = require(whatap_path, 'utf8');
13
+ const whatapPath = require.resolve('whatap/package.json');
14
+ NodeUtil.packageJson = require(whatapPath);
19
15
  return;
20
16
  } catch(e) {
21
17
  }
18
+
19
+ try{
20
+ const globalPath = execSync('npm root -g').toString().trim();
21
+ const globalWhatapPath = path.join(globalPath, 'whatap', 'package.json');
22
+ NodeUtil.packageJson = require(globalWhatapPath);
23
+ return;
24
+ }catch (e) {
25
+ }
22
26
  NodeUtil.packageJson = {};
23
27
  }
24
28
  function recursiveCall(fullPath, file, cb){
@@ -65,4 +69,4 @@ var NodeUtil = {
65
69
  packageJson : {}
66
70
  };
67
71
 
68
- module.exports = NodeUtil;
72
+ module.exports = NodeUtil;
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "whatap",
3
3
  "homepage": "http://www.whatap.io",
4
- "version": "0.5.6",
5
- "releaseDate": "20250123",
4
+ "version": "0.5.7",
5
+ "releaseDate": "20250207",
6
6
  "description": "Monitoring and Profiling Service",
7
7
  "main": "index.js",
8
8
  "scripts": {},