
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
waveform-thumbnail
Advanced tools
![]()
A simple audio waveform image generator with no hard dependencies outside npm.
Just convert your audio to 32 bit little endian raw before converting. How you accomplish this depends on your platform, but here's how to do it with sox:
sox foo.mp3 --bits 32 --encoding signed-integer --endian little foo.raw remix 1,2
Currently I can't find and modules in NPM that will do this conversion for us without installing / compiling tools outside npm first. So I built this to work well in conjunction with sox, which is pretty well supported everywhere.
var Waveform = require('waveform');
var waveform = new Waveform( './someAudio.raw' );
waveform.renderAndSave( './prettyImage.png', function(err){
console.log( "neato!" )
});
If you want more control, you can set color options.
//...
var waveform = new Waveform( './someAudio.raw', {
w: 500,
h: 100,
backgroundColor: '#333',
waveColor: '#fff'
});
//...
You can also define your own gradient. This is the default one:
//...
var waveform = new Waveform( './someAudio.raw', {
w: 500,
h: 100,
backgroundColor: '#333',
waveColor: [
{stop: 0, color: "#333"},
{stop: 0.5, color: "#333"},
{stop: 0.5, color: "#444"},
{stop: 1, color: "#eee"}
]
});
//...
This tool is built on top of node canvas, and that canvas object is exposed if you want to do stuff with it before saving.
//...
waveform.render( function(err, ctx){
ctx.fillStyle = 'red';
ctx.fillRect( 0,0,10,10 );
// etc
waveform.save( './myWaveformAndRedBox.png', function(err){
console.log( "yay" );
})
});
If you have trouble node-canvas running on OSX: [https://github.com/Automattic/node-canvas/wiki/Installation---OSX]
Pull requests and bug reports are very welcome. Thanks!
FAQs

We found that waveform-thumbnail 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.