Created
August 25, 2017 13:07
-
-
Save J2D2Development/15ef9a192fb558f2d88027d74ae0a6b8 to your computer and use it in GitHub Desktop.
Take a file, use transform stream to strip multi-spaces, stream to different path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const fs = require('fs'); | |
const spaceStripStream = require('./multi-space-strip'); | |
const pathSplitter = require('./path-splitter'); | |
const filePath = process.argv[2]; | |
fs.createReadStream(filePath) | |
.pipe(spaceStripStream) | |
.pipe(fs.createWriteStream(pathSplitter(filePath, 'stripped'))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment