I see in top of the fs.js
there is a process.binding('fs')
.
https://github.com/nodejs/node/blob/master/lib/fs.js#L10:
const binding = process.binding('fs');
And then, it's used as:
binding.open(pathModule._makeLong(path),
stringToFlags(flag),
0o666,
req);
(In https://github.com/nodejs/node/blob/master/lib/fs.js#L303-L306)
My question is:
- What does
process.binding('fs')
mean? - What's
fs
here (We already infs.js
)? - Where can I find the source code of
binding.open
? Is it Javascript code or c/c++ code?