Created
March 31, 2017 11:11
-
-
Save matteofigus/1b9aa210ef3b67ae1be263a0deb426f2 to your computer and use it in GitHub Desktop.
Replace nbsp to regular whitespace in a folder of files
This file contains hidden or 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
const _ = require('lodash') | |
const fs = require('fs') | |
const location = './en-us' | |
const files = fs.readdirSync(location) | |
_.each(files, (file) => { | |
const filePath = `${location}/${file}` | |
const content = fs.readFileSync(filePath, 'utf-8') | |
fs.writeFileSync(filePath, content.replace(/ /g, ' ')) | |
}) | |
console.log('done') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment