Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
base64-file-encoder
Advanced tools
A Node.js module to base64 encode/decode a file and save it to disk
Install with npm
:
$ npm install base64-file-encoder --save
const b64File = require('base64-file-encoder');
// base64 encodes the content of foo.txt and outputs it to bar.txt
b64File.encode('foo.txt', 'bar.txt')
.then(function(){
// if foo.txt content was 'foo', bar.txt content will be 'Zm9v'
console.log('file was encoded');
})
.catch(function(error){
console.log(error);
});
// base64 encodes the content of foo.txt and outputs it to the same
// file (i.e. overwrites it)
b64File.encode('foo.txt')
.then(function(){
console.log('file was encoded and overwritten');
})
.catch(function(error){
console.log(error);
});
// base64 decodes the content of bar.txt and outputs it to foo.txt
b64File.decode('bar.txt', 'foo.txt')
.then(function(){
// if bar.txt content was 'Zm9v', foo.txt content will be 'foo'
console.log('file was decoded');
})
.catch(function(error){
console.log(error);
});
// base64 decodes the content of bar.txt and outputs it to the same
// file (i.e. overwrites it)
b64File.decode('bar.txt')
.then(function(){
console.log('file was decoded and overwritten');
})
.catch(function(error){
console.log(error);
});
Base64 encodes the contents of a file and outputs it to another file (outputFilePath) or to the same file (if outputPath is not provided).
This function returns a promise.
Decodes the contents of a base64 encoded file and outputs it to another file (outputFilePath) or to the same file (if outputPath is not provided).
This function returns a promise.
MIT. See LICENSE.md for details.
FAQs
base64 encode/decode a file and save it to disk
We found that base64-file-encoder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.