
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
@purinton/resampler
Advanced tools
A pure JavaScript, high-quality PCM audio resampler for Node.js. Converts s16le PCM between arbitrary sample rates and channel layouts (mono/stereo) with windowed-sinc filtering.

A pure JavaScript, high-quality PCM audio resampler for Node.js. Converts s16le PCM between arbitrary sample rates and channel layouts (mono/stereo) with windowed-sinc filtering. Includes built-in volume control.
npm install @purinton/resampler
import { Resampler } from '@purinton/resampler';
import fs from 'fs';
// Downsample 48kHz stereo to 24kHz mono
const resampler = new Resampler({ inRate: 48000, outRate: 24000, inChannels: 2, outChannels: 1 });
fs.createReadStream('input-48k-stereo.s16le')
.pipe(resampler)
.pipe(fs.createWriteStream('output-24k-mono.s16le'));
// Downsample with half volume
const resamplerQuiet = new Resampler({ inRate: 48000, outRate: 24000, inChannels: 2, outChannels: 1, volume: 0.5 });
fs.createReadStream('input-48k-stereo.s16le')
.pipe(resamplerQuiet)
.pipe(fs.createWriteStream('output-24k-mono-quiet.s16le'));
const { Resampler } = require('@purinton/resampler');
const fs = require('fs');
// Upsample 24kHz mono to 48kHz stereo
const resampler = new Resampler({ inRate: 24000, outRate: 48000, inChannels: 1, outChannels: 2 });
fs.createReadStream('input-24k-mono.s16le')
.pipe(resampler)
.pipe(fs.createWriteStream('output-48k-stereo.s16le'));
// Upsample with lower volume
const resamplerQuiet = new Resampler({ inRate: 24000, outRate: 48000, inChannels: 1, outChannels: 2, volume: 0.2 });
fs.createReadStream('input-24k-mono.s16le')
.pipe(resamplerQuiet)
.pipe(fs.createWriteStream('output-48k-stereo-quiet.s16le'));
Creates a Transform stream that resamples s16le PCM audio.
inRate (number): Input sample rate (e.g. 48000)outRate (number): Output sample rate (e.g. 24000)inChannels (number, default 1): Number of input channels (1=mono, 2=stereo)outChannels (number, default 1): Number of output channels (1=mono, 2=stereo)filterWindow (number, default 8): Sinc filter window size (higher = better quality, more CPU)volume (number, default 1.0): Output volume multiplier (0.0 = silence, 1.0 = unchanged, >1.0 = amplify)const resampler = new Resampler({ inRate: 48000, outRate: 24000, inChannels: 2, outChannels: 1, volume: 0.5 });
Pipe PCM data through the resampler:
inputStream.pipe(resampler).pipe(outputStream);
Type definitions are included:
import { Resampler, ResamplerOptions } from '@purinton/resampler';
const resampler: Resampler = new Resampler({
inRate: 48000,
outRate: 24000,
inChannels: 2,
outChannels: 1,
volume: 0.5,
});
For help, questions, or to chat with the author and community, visit:
FAQs
A pure JavaScript, high-quality PCM audio resampler for Node.js. Converts s16le PCM between arbitrary sample rates and channel layouts (mono/stereo) with windowed-sinc filtering.
The npm package @purinton/resampler receives a total of 1,441 weekly downloads. As such, @purinton/resampler popularity was classified as popular.
We found that @purinton/resampler 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.
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
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.