How to use the pn/fs.createWriteStream function in pn

To help you get started, we’ve selected a few pn 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 wikimedia / parsoid / tools / fetch-parserTests.txt.js View on Github external
https.get(url, function(result) {
			var targetPath = path.join(testDir, targetName);
			var out = fs.createWriteStream(targetPath);
			result.on('data', function(data) {
				out.write(data);
			});
			result.on('end', function() {
				out.end();
				out.destroySoon();
			});
			out.on('close', resolve);
		}).on('error', function(err) {
			console.error(err);