src/index.js
function watchFile(file, callback) {
	let absolutePath = File.find(file).path();
	let watcher = chokidar
		.watch(
			absolutePath,
			{
				persistent: true
			}
		)
		.on(
			'change',
			function () {
				if (typeof callback === 'function') {
					callback(file);
				}
				watcher.unwatch(absolutePath);
				watchFile(file, callback);
			}
		)
	;
}
function watchFile(file, callback) {
	let absolutePath = File.find(file).path();
	let watcher = chokidar
		.watch(
			absolutePath,
			{
				persistent: true
			}
		)
		.on(
			'change',
			function () {
				if (typeof callback === 'function') {
					callback(file);
				}
				watcher.unwatch(absolutePath);
				watchFile(file, callback);
			}
		)
	;
}
function watchFile ( file , callback ) { let absolutePath = File . find ( file ) . path ( ) ; let watcher = chokidar . watch ( absolutePath , { persistent : true } ) . on ( 'change' , function ( ) { if ( typeof callback === 'function' ) { callback ( file ) ; } watcher . unwatch ( absolutePath ) ; watchFile ( file , callback ) ; } ) ; }
Watch the file's changes.

@param {string}   file     The file.
@param {Function} callback The callback function.
Watch the file s changes .