https://github.com/defite/bom-bom
Parse directory, find files with BOM and remove bom from these files
https://github.com/defite/bom-bom
bom eslint nodejs utf8
Last synced: about 2 months ago
JSON representation
Parse directory, find files with BOM and remove bom from these files
- Host: GitHub
- URL: https://github.com/defite/bom-bom
- Owner: Defite
- Created: 2018-07-10T15:12:49.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-03T15:39:17.000Z (about 3 years ago)
- Last Synced: 2025-08-23T09:07:53.554Z (9 months ago)
- Topics: bom, eslint, nodejs, utf8
- Language: JavaScript
- Homepage:
- Size: 116 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# What is BOM, baby don't hurt me, no more...
**BOM - Byte Order Mark** - is Unicode character (`U+FEFF`) which is placed at the start of the text stream. Its appearence at the start of the text stream means that:
- the byte order of the text stream
- the fact that text stream is encoded in Unicode
- signals to a program which Unicode encoding the text stream is encoded
[Read more about BOM](https://en.wikipedia.org/wiki/Byte_order_mark)
# bom-bom
Parse directory, find files with bom and remove BOM from these files
## Install
`npm i` or `yarn`
## Use
This will simply scan target folder and recursively remove BOM from all files inside.
`npm run bom_bom /myfolder/new_folder/` or
`yarn bom_bom /myfolder/new_folder/`
Sometimes you don't want to touch all files. You can provide extension of files which yon wanna cure.
`npm run bom_bom /myfolder/new_folder/ .js` or
`yarn bom_bom /myfolder/new_folder/ .js`
Get files from target dir and rewrite 'em w/o BOM. Hooray.
## Check for BOM
To be ensured that final file/files doesn't contain BOM, you can use eslint:
`npm run lint`
If you have BOM in your files, you'll get following error:

## Play
You can generate more files with BOM in case you have fixed previous files. Simply run:
`npm run gen_bom`