Skip to content

Latest commit

 

History

History
9 lines (7 loc) · 431 Bytes

file-system-flags-in-node.md

File metadata and controls

9 lines (7 loc) · 431 Bytes

File system flags in Node

Node.js's filesystem module provides some useful flags that can help decrease code complexity. This file was created with the wx flag for example. w is write mode, and x will cause an error to be thrown if the file already exists. This saves one round trip and a race condition if existsSync or access had to be used beforehand.

source