Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including somafm with all npm packages installed. Try it out:

var somafm = require("somafm")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

somafm v2.7.0

Play and record SomaFM radio channels

SomaFM Build Status

Play & record SomaFM radio channels



With yarn:

$ yarn global add somafm

or with npm:

$ npm install --global somafm

Playing a channel requires MPlayer or mpv on your system. Please make sure you have at least one of them installed and the mplayer or mpv command can be run within your shell.

To record a channel, you need Streamripper and its executable streamripper.



$ somafm

Interactive mode. Choose a channel to play from the list.

$ somafm list [<keywords>]

Show a list of all SomaFM channels. You can filter by one or more keywords.

$ somafm play <channel> | random

Play a channel. To specify a channel, use the ID from the channel list (lower-case, no spaces), e.g. beatblender. Use random to play any channel.

$ somafm info <channel>

Get channel information.

$ somafm record <channel>

Record a channel. Tracks are saved into a directory containing channel name, date and time, e.g. SomaFM Groove Salad/20171011_213324. It is automatically created in the current working directory.

$ somafm list-favourites [<keywords>]

List your favourite songs. You can filter by one or more keywords in song title and channel name.

$ somafm edit-favourites

Edit your favourites songs file.

Command aliases

All commands have short aliases for faster typing.




Don't show desktop notifications.

Keyboard shortcuts

While playing, the following keyboard shortcuts are available:

Copy current song title to clipboardc
Add current song to favourites+ or f
Remove current song from favourites- or u
Increase volume** or 0
Decrease volume*/ or 9
Enable desktop notificationsd
Disable desktop notificationsn
Stop playback & quit applicationq or esc

_* MPlayer only_


MIT © Christoph Uschkrat


RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free