Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
datauri-stream
Advanced tools
Lightweight data
─► data URI
transform stream.
Use with the file system:
var DataUri = require('datauri-stream')
var fs = require('fs')
fs.createReadStream('./picture.jpg')
.pipe(DataUri())
.pipe(process.stdout)
// 'data:image/jpg;base64,iVBORw0KGg...'
Use with http requests:
var DataUri = require('datauri-stream')
var http = require('http')
http.get('http://josephdykstra.com/logo.png', function(res) {
res.pipe(DataUri())
.pipe(process.stdout)
// 'data:image/png;base64,Vs8uZ29vZG...'
})
Use on the browser with browserify:
var DataUri = require('datauri-stream')
var hyperquest = require('hyperquest')
var concat = require('concat-stream')
hyperquest('https://www.npmjs.com/static/images/npm-logo.svg')
.pipe(DataUri({ mime: 'image/svg' }))
.pipe(concat(function (dataUri) {
var img = document.createElement('img')
img.src = dataUri
document.body.appendChild(img)
}))
var DataUriStream = require('datauri-stream')
var ts = DataUriStream([opts])
opts.mime
An optional override for the mime type.
The mime type will be automatically detected otherwise, using the file-type module. It supports many file types.
If the source is not a file, then you'll want to supply the mime type.
ts
A standard Transform Stream. Pipe to and from it.
With npm do:
npm install datauri-stream
pipe-transform-cli
- Command line utility to pipe one input encoding to another encodingFAQs
Lightweight data -> data URI transform stream
The npm package datauri-stream receives a total of 2 weekly downloads. As such, datauri-stream popularity was classified as not popular.
We found that datauri-stream 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.