Skip to content

Commit

Permalink
refactor: change safety var to const
Browse files Browse the repository at this point in the history
  • Loading branch information
wallet77 committed Feb 27, 2018
1 parent 0cab888 commit 047aa49
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/API.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 047aa49

Please sign in to comment.