1.0.5 • Published 8 years ago
base64-file-coder-node v1.0.5
Base64 file encoder/decoder.
Installation
npm install base64-file-coder-node
Usage Example
var base64File = require('base64-file-coder-node')();
base64File.encode('path/to/file', function (error, base64) {
if (!error) {
console.log(base64);
} else {
console.error(error);
}
});
console.log(base64File.decode('TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZX...'));
TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVlciBhZGlwaXNjaW5nI...
<Buffer 4c 6f 72 65 6d 20 69 70 73 75 6d 20 64 6f 6c 6f 72 20 73 69 ... >
Tests
To run the test suite, first install the dependencies, then run npm test
:
$ npm install
$ npm test
License
Distributed under the MIT License.