Strips BOM (byte order mark) from files encoded as UTF8-BOM, saving them back in plain UTF8 format. Can batch convert multiple files at once, or even entire directories (including sub-directories).
$ npm install -g cli-bomstrip
$ bomstrip <path1 path2 ...> [-o outputPath] [--log]
$ bomstrip
$ bomstrip *.json
$ bomstrip file1.txt file2.txt
$ bomstrip inputDir -o outputDir
$ bomstrip . --log
If no options or paths are passed, will operate on all files within the cwd.
path[n]: Paths to files or directories to remove BOM from. Files will be edited in place unless -o flag is used. If directory is passed, every file in the directory is considered (including all sub-directories recursively). Can use wildcards depennding on OS (for example bomstrip *.json).
-o outputPath: Instead of editing files in-place, write them to this path. Will preserve directory structure for nested sub-directories.
--log: Log the path of every modified file.
MIT