msoc
encrypt and decrypt ms office file using password, for Linux only
installation
Make sure to have git and make installed. The installation process will build shared library from https://github.com/herumi/msoffice. This package only binds built library into nodejs
usages
Decryption
const msoc = require('msoc');
const errno = msoc.input('/path/to/input_file.xlsx')
.output('/path/to/output_file.xlsx')
.password('password')
.decrypt();
Encryption
const msoc = require('msoc');
const errno = msoc.input('/path/to/input_file.xlsx')
.output('/path/to/output_file.xlsx')
.password('password')
.encrypt();
from the codes above, errno will contain error code returned from the process. To get error message, you can use
const errMsg = msoc.getErrorMessage(errno);
console.log(errMsg);