Skip to content

Instantly share code, notes, and snippets.

@J2D2Development
Created August 25, 2017 13:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save J2D2Development/15ef9a192fb558f2d88027d74ae0a6b8 to your computer and use it in GitHub Desktop.
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
'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