cheap-watch
Advanced tools
Comparing version
'use strict'; | ||
var EventEmitter = require('events'); | ||
var events = require('events'); | ||
var fs = require('fs'); | ||
@@ -9,3 +9,3 @@ var util = require('util'); | ||
const stat = util.promisify(fs.stat); | ||
class CheapWatch extends EventEmitter { | ||
class CheapWatch extends events.EventEmitter { | ||
constructor(data) { | ||
@@ -12,0 +12,0 @@ super(); |
@@ -1,7 +0,7 @@ | ||
import * as EventEmitter from 'events'; | ||
import { watch, readdir as readdir$1, stat as stat$1 } from 'fs'; | ||
import { EventEmitter } from 'events'; | ||
import * as fs from 'fs'; | ||
import { promisify } from 'util'; | ||
const readdir = promisify(readdir$1); | ||
const stat = promisify(stat$1); | ||
const readdir = promisify(fs.readdir); | ||
const stat = promisify(fs.stat); | ||
class CheapWatch extends EventEmitter { | ||
@@ -62,3 +62,3 @@ constructor(data) { | ||
if (this.watch) { | ||
this._watchers.set(path, watch(full, this._handle.bind(this, full)).on('error', () => { })); | ||
this._watchers.set(path, fs.watch(full, this._handle.bind(this, full)).on('error', () => { })); | ||
} | ||
@@ -134,3 +134,3 @@ await Promise.all((await readdir(full)).map(sub => this._recurse(full + '/' + sub))); | ||
export default CheapWatch; | ||
export { CheapWatch as default }; | ||
//# sourceMappingURL=CheapWatch.esm.js.map |
{ | ||
"name": "cheap-watch", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "If it works, why use something else?", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
-100%37194
-3.38%8
-11.11%