Karl Morrison Karl Morrison - 3 months ago 53
Node.js Question

mode: 0o666 in file system methods, what is it?

https://nodejs.org/api/fs.html#fs_fs_createwritestream_path_options

It mentions the option

mode
with the value
0o666
. As you can read if you click the link there is no real description of what this.

I am presuming it is the file permission to be set. However I'm not used to seeing
0o666
. Am I correct that it is the file permission and if so, what does
0o666
stand for?

Answer

I was correct it was octal file permissions for the file. 0o is ES6 represents octal.

http://www.2ality.com/2015/04/numbers-math-es6.html

Comments