Skip to content
Permalink
Browse files

refactor: change safety var to const

  • Loading branch information...
wallet77 committed Feb 27, 2018
1 parent 0cab888 commit 047aa494d5c4dd4342915766b54d673db0d5cdf1
Showing with 12 additions and 12 deletions.
  1. +12 −12 lib/API.js
@@ -4,14 +4,14 @@
* can be found in the LICENSE file.
*/

var commander = require('commander');
var fs = require('fs');
var path = require('path');
var async = require('async');
var debug = require('debug')('pm2:cli');
var util = require('util');
var chalk = require('chalk');
var fclone = require('fclone');
const commander = require('commander');
const fs = require('fs');
const path = require('path');
const async = require('async');
const debug = require('debug')('pm2:cli');
const util = require('util');
const chalk = require('chalk');
const fclone = require('fclone');

var conf = require('../constants.js');
var Client = require('./Client');
@@ -49,7 +49,7 @@ class API {

constructor (opts) {
if (!opts) opts = {};
var that = this;
const that = this;

this.daemon_mode = typeof(opts.daemon_mode) == 'undefined' ? true : opts.daemon_mode;
this.pm2_home = conf.PM2_ROOT_PATH;
@@ -78,8 +78,8 @@ class API {
}
else if (opts.independent == true && conf.IS_WINDOWS === false) {
// Create an unique pm2 instance
var crypto = require('crypto');
var random_file = crypto.randomBytes(8).toString('hex');
const crypto = require('crypto');
const random_file = crypto.randomBytes(8).toString('hex');
this.pm2_home = path.join('/tmp', random_file);

// If we dont explicitly tell to have a daemon
@@ -111,7 +111,7 @@ class API {
this.gl_is_km_linked = false;

try {
var pid = fs.readFileSync(conf.INTERACTOR_PID_PATH);
const pid = fs.readFileSync(conf.INTERACTOR_PID_PATH);
pid = parseInt(pid.toString().trim());
process.kill(pid, 0);
that.gl_is_km_linked = true;

0 comments on commit 047aa49

Please sign in to comment.
You can’t perform that action at this time.