
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
A streaming base64 decoder. Built to play with IRHydra2. You probably don't need it.
var fromBase64 = require('de-base64')
someBase64Stream.pipe(fromBase64())
Create a new transform stream, passing opts through.
A low-level, streaming base64 decoder.
Decodes base64 input from the chunk directly back into the chunk.
Returns the new length so you can slice the chunk yourself.
Note: After painstaking optimization, it turns out that simply calling new Buffer(chunk, 'base64') inside a simple transform stream is faster. But what
about memory usage, you cry out? Surely you could blit the output back into
the incoming buffer, and not have to make so many copies!
Sure enough, you can -- and I tried that. Doing so is unsafe and breaks the stream API contract, and worse of all, really slows things down. You can't even avoid allocating new objects -- you have to slice the original buffer, so you're at least allocating a new Buffer.
This library exists mostly because I think bit-twiddling and JS optimization are fun. It might be more useful if the chunks you're receiving are small (so you can avoid hopping between C++ and JS a bunch), or if you're in browser; I am not holding out a lot of hope there, though.
In lieu of a specific purpose, I'd like to direct you to decoder.js -- I
detail some of the approaches I tried there.
MIT
FAQs
decode base64 buffers in place (no copying!)
The npm package de-base64 receives a total of 0 weekly downloads. As such, de-base64 popularity was classified as not popular.
We found that de-base64 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
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.