Security News
Combatting Alert Fatigue by Prioritizing Malicious Intent
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
base64-png-uploader
Advanced tools
A simple module to upload png files to different services from base64 encoded pic.
Upload a base64 encoded png to S3 or file system. Other cloud storage services could be or not here soon ;) Very useful to use with Test Automation with Selenium to store screenshots taken.
npm install base64-png-uploader
var uploader = require('base64-png-uploader');
// if you do not export AWS_ACCESS_KEY_ID and AWS_ACCESS_KEY_ID
uploader.awsCredentialsFromPath('path_to_JSON_FILE');
uploader.asS3('BUCKET_NAME');
uploader.store('FILE_NAME|PATH+FILE_NAME', 'BASE_64_ENCODED_PNG', function(error, data){})
For more information about credentials and aws-sdk click here. The callback function will be called from s3.putObject so you maybe want to check documentation.
var uploader = require('base64-png-uploader');
// if you do not export AWS_ACCESS_KEY_ID and AWS_ACCESS_KEY_ID
uploader.store('FILE_NAME|PATH+FILE_NAME', 'BASE_64_ENCODED_PNG', function(error){})
The callback function will be called from fs.writeFile
so you maybe want to check documentation.
selenium.takeScreenshot()
.then((image, err) => {
uploader.asS3('BUCKET_NAME').store('FILE_NAME.PNG', image, (err, data) => {
//do whatever you want after image is saved
}
);
});
MIT
FAQs
A simple module to upload png files to different services from base64 encoded pic.
We found that base64-png-uploader 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
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.