A node c++ addon to I/O file. Just a example to learn how to write c++ addon. There are two types: use native code and use boost lib.
Install dependences
$ npm install
$ const { readFile, writeFile } = require('./src/native/build/Release/addon.node');
$ const buffer = readFile('filePath');
$ writeFile('filePath', buffer);
Install boost and compile boost lib
$const { readFile, writeFile } = require('./src/boost/build/Release/addon.node');
$ const buffer = readFile('filePath');
$ writeFile('filePath', buffer);
1、Buffer readFile(string filePath)
2、void writeFile(string filePath, Buffer content)
Node addon is compiled in x64, boost lib either.
If your platform is x86 , you need to recompile.