How to use the klaw.on function in klaw

To help you get started, we’ve selected a few klaw 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 quinton-ashley / nostlan / views / js / gameLibViewer.js View on Github external
return new Promise((resolve, reject) => {
			let items = [];
			let i = 0;
			require('klaw')(dir, options)
				.on('data', item => {
					if (i > 0) {
						items.push(item.path);
					}
					i++;
				})
				.on('end', () => resolve(items))
				.on('error', (err, item) => reject(err, item));
		});
	};
github quinton-ashley / nostlan / core / setup.js View on Github external
return new Promise((resolve, reject) => {
			let items = [];
			let i = 0;
			require('klaw')(dir, opt)
				.on('data', item => {
					if (i > 0) {
						items.push(item.path);
					}
					i++;
				})
				.on('end', () => resolve(items))
				.on('error', (err, item) => reject(err, item));
		});
	};

klaw

File system walker with Readable stream interface.

MIT
Latest version published 1 year ago

Package Health Score

74 / 100
Full package analysis

Popular klaw functions