@vbarbarosh/node-helpers 3.50.1 → 3.51.0

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/fs_fopen.js +5 -1
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": "Vladimir Barbarosh <vladimir.barbarosh@gmail.com>",
3
3
  "license": "MIT",
4
4
  "name": "@vbarbarosh/node-helpers",
5
- "version": "3.50.1",
5
+ "version": "3.51.0",
6
6
  "description": "A set of helpers for JavaScript/Node.js",
7
7
  "files": [
8
8
  "src"
package/src/fs_fopen.js CHANGED
@@ -2,7 +2,11 @@ const fs = require('fs');
2
2
 
3
3
  function fs_fopen(file, flags = 'r', mode = 0o666)
4
4
  {
5
- return fs.promises.open(file, flags, mode);
5
+ return new Promise(function (resolve, reject) {
6
+ fs.open(file, flags, mode, function (error, out) {
7
+ error ? reject(error) : resolve(out);
8
+ });
9
+ });
6
10
  }
7
11
 
8
12
  module.exports = fs_fopen;