
Security News
OpenCode User Hit with Hostile Backlash After Reporting Free AI Loophole
An OpenCode user faced harassment after reporting a free AI usage loophole, drawing a bitter backlash in a GitHub thread that has since been deleted.
Encode and decode base64 strings. Written in TypeScript, published with both ES module and CommonJS builds and type declarations. Requires Node.js 20 or newer.
Install with npm
npm install libbase64
Require in your script
const libbase64 = require('libbase64');
or import it as an ES module
import libbase64 from 'libbase64';
// or
import { encode, decode, wrap, Encoder, Decoder } from 'libbase64';
Encode Buffer objects or unicode strings with
libbase64.encode(val) → String
Where
Example
libbase64.encode('jõgeva');
// asO1Z2V2YQ==
Decode base64 strings to a Buffer with
libbase64.decode(str) → Buffer
Where
Example
libbase64.decode('asO1Z2V2YQ==').toString();
// jõgeva
To enforce soft line breaks on lines longer than selected amount of characters, use wrap
libbase64.wrap(str[, lineLength]) → String
Where
Example
libbase64.wrap('asO1Z2V2asO1Z2V2asO1Z2V2YQ==', 10);
// asO1Z2V2as\r\n
// O1Z2V2asO1\r\n
// Z2V2YQ==
libbase64 makes it possible to encode and decode streams with libbase64.Encoder and libbase64.Decoder constructors.
Create new Encoder Stream with
const encoder = new libbase64.Encoder([options])
Where
false to turn the soft wrapping off completely)limitOutbutBytes that earlier versions documented is still acceptedThe output is the same as libbase64.wrap(libbase64.encode(input), lineLength), no matter how the input is split into chunks.
Example
The following example script reads in a file, encodes it to base64 and saves the output to a file.
const libbase64 = require('libbase64');
const fs = require('fs');
const source = fs.createReadStream('source.txt');
const encoded = fs.createWriteStream('encoded.txt');
const encoder = new libbase64.Encoder();
source.pipe(encoder).pipe(encoded);
Create new Decoder Stream with
const decoder = new libbase64.Decoder([options])
Where
Example
The following example script reads in a file in base64 encoding, decodes it and saves the output to a file.
const libbase64 = require('libbase64');
const fs = require('fs');
const encoded = fs.createReadStream('encoded.txt');
const dest = fs.createWriteStream('dest.txt');
const decoder = new libbase64.Decoder();
encoded.pipe(decoder).pipe(dest);
MIT
A small JavaScript library for converting between Base64 strings and byte arrays. It is a close alternative for binary data, but its API focuses on Uint8Array-style data rather than text encodings.
A general-purpose Base64 library with string and byte-oriented helpers and support for URL-safe Base64. It offers a broader set of convenience APIs than libbase64.
Encodes and decodes Base64 using ArrayBuffer data, making it a good fit for browser-oriented binary workflows. Its focus is narrower than libbase64's Node.js text and binary use cases.
Provides Base64 URL-safe encoding and decoding. It is a better fit when values must be safe for URLs or filenames, while libbase64 is oriented toward general Base64 conversion.
FAQs
Encode and decode base64 encoded strings
The npm package libbase64 receives a total of 7,132,168 weekly downloads. As such, libbase64 popularity was classified as popular.
We found that libbase64 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
An OpenCode user faced harassment after reporting a free AI usage loophole, drawing a bitter backlash in a GitHub thread that has since been deleted.

Threat Research
/Security News
319 browser extensions installed by 13.4 million users hijack searches, capture queries, and collect referral payments from Yahoo and Bing.

Threat Research
Malicious Firefox extensions mimic Phantom, Jupiter, and Bitget wallets to steal recovery phrases and private keys, with one fetching its payload remotely.