How to use the safefs.watchFile function in safefs

To help you get started, we’ve selected a few safefs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bevry / watchr / source / index.js View on Github external
// Success
			next()
			return
		} else if (method === 'watchFile') {
			// Check
			if (fsUtil.watchFile == null) {
				const err = new Error(
					'watchFile method is not supported on this environment, fs.watchFile does not exist'
				)
				next(err)
				return
			}

			// Watch
			try {
				fsUtil.watchFile(
					this.path,
					{
						persistent: this.config.persistent,
						interval: this.config.interval
					},
					(...args) => this.listener({ method, args })
				)
			} catch (err) {
				next(err)
				return
			}

			// Success
			next()
			return
		} else {

safefs

Stop getting EMFILE errors! Open only as many files as the operating system supports.

Artistic-2.0
Latest version published 12 months ago

Package Health Score

63 / 100
Full package analysis