Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hack: use chokidar@2 only on node < 8 #198

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/forever-monitor/monitor.js
Expand Up @@ -17,7 +17,6 @@ const plugins = require('./plugins');
const utils = require('./utils');
const util = require('util');


Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those irrelevant changes are caused by running npm run prettier

//
// ### function Monitor (script, options)
// #### @script {string} Location of the target script to run.
Expand Down
5 changes: 4 additions & 1 deletion lib/forever-monitor/plugins/watch.js
Expand Up @@ -9,7 +9,10 @@
const fs = require('fs'),
path = require('path'),
minimatch = require('minimatch'),
chokidar = require('chokidar');
chokidar =
parseInt(process.versions.node) >= 8
? require('chokidar')
: require('@nicolo-ribaudo/chokidar-2');

exports.name = 'watch';

Expand Down
3 changes: 2 additions & 1 deletion lib/forever-monitor/utils.js
Expand Up @@ -7,7 +7,8 @@
//
function randomString(length) {
let rand, i, ret, bits;
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-';
const chars =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-';
const mod = 4;

ret = '';
Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Expand Up @@ -6,7 +6,7 @@
*
*/

const utils = require('./forever-monitor/utils')
const utils = require('./forever-monitor/utils');
const common = require('./forever-monitor/common');

exports.kill = common.kill;
Expand Down
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -50,8 +50,9 @@
"tools"
],
"dependencies": {
"@nicolo-ribaudo/chokidar-2": "^2.1.8",
"async": "^1.5.2",
"chokidar": "^2.1.8",
"chokidar": "^3.4.3",
"eventemitter2": "^6.4.3",
"minimatch": "^3.0.4",
"ps-tree": "^1.2.0"
Expand Down