Skip to content

Latest commit

History

History
57 lines (40 loc) 路 1.96 KB

File metadata and controls

57 lines (40 loc) 路 1.96 KB

馃摑 EOF and BOM

Substitute character

The substitute character (CTRL-Z) stops file streams on some Windows commands when in text mode. This includes the type command in cmd.exe.

As a consequence that character should be avoided in non-binary files.

End Of File

As opposed to Windows, Unix requires text files to end with a newline character.

However please remember that Windows might print these as if two newlines were present instead.

Byte Order Mark

The BOM is a special character at the beginning of a file indicating its endianness and character encoding.

Since it creates issues with shebangs and adds little value to UTF-8, it is better not to add it to new files. However if a BOM is present in input, it should be properly handled. Fortunately this is the default behavior of Node.js core methods, so this should usually not create any issues.

Linting

Character encoding, newlines and EOF behavior should be specified with editorconfig. They can also be enforced with tools like ESLint and Prettier.

Summary

Avoid the substitute character (CTRL-Z) in non-binary files.

End files with a newline.

Use editorconfig.


Next (馃搨 Filesystem)
Previous (馃摑 Newlines)
Top