loggj 1.0.7 → 1.0.9

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.
@@ -1,12 +1,13 @@
1
1
  'use strict';
2
2
 
3
- const fs = require('fs').promises;
3
+ const fs = require('fs');
4
+ const fsPromises = fs.promises;
4
5
  var util = require('util');
5
6
  var lockFile = require('lockfile');
6
7
  var path = require('path');
7
8
 
8
- var stat = fs.stat;
9
- var readdir = fs.readdir;
9
+ var stat = fsPromises.stat;
10
+ var readdir = fsPromises.readdir;
10
11
 
11
12
  var compileFormat = require('../utils/compileFormat');
12
13
 
@@ -197,7 +197,8 @@ module.exports.compileFormat = compileFormat = function(text, _defaultDateFormat
197
197
  };
198
198
 
199
199
  const fs = require('fs').promises;
200
- var glob = require('./re-glob');
200
+ const util = require('util');
201
+ var glob = util.promisify(require('./re-glob'));
201
202
  var path = require('path');
202
203
 
203
204
  var stat = fs.stat;
@@ -220,9 +221,7 @@ function compareByTime(f1, f2) {
220
221
  FileRemover.prototype.deleteOldFiles = function() {
221
222
  var that = this;
222
223
 
223
- return new Promise((resolve, reject) => {
224
- glob(this.filesFormat, resolve);
225
- }).then(function(matchedFiles) {
224
+ return glob(this.filesFormat).then(function(matchedFiles) {
226
225
  return Promise.all(matchedFiles.map(function(file) {
227
226
  if(that.timeCache[file])
228
227
  return Promise.resolve([file, that.timeCache[file]]);
@@ -68,9 +68,9 @@ function Minimatch(pattern, options) {
68
68
 
69
69
 
70
70
 
71
- module.exports = glob
71
+ module.exports = glob;
72
72
 
73
- const fs = require('fs').promises;
73
+ const fs = require('fs');
74
74
  var inherits = require("util").inherits
75
75
  , EE = require("events").EventEmitter
76
76
  , path = require("path")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loggj",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "dependencies": {
5
5
  "chalk": "^1.1.1",
6
6
  "lockfile": "^1.0.1",