Skip to content

Commit

Permalink
Fix argument type of fs.writeFileSync (#1075)
Browse files Browse the repository at this point in the history
It causes error in Node version 14+.
A number type is not valid for the second argument
of fs.writeFileSync from the documentation.
https://nodejs.org/docs/latest-v14.x/api/fs.html#fs_fs_writefilesync_file_data_options
  • Loading branch information
sapics committed May 22, 2020
1 parent 58eb131 commit 9e85c59
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/monitor
Expand Up @@ -10,7 +10,7 @@ var fs = require('fs'),
// Write the pidFile to disk for later use
//
function writePid(file, pid) {
fs.writeFileSync(file, pid, 'utf8');
fs.writeFileSync(file, String(pid), 'utf8');
}

//
Expand Down Expand Up @@ -84,4 +84,4 @@ process.on('message', function (data) {
started = true;
start(options);
}
});
});

0 comments on commit 9e85c59

Please sign in to comment.