What is beeper?
The 'beeper' npm package allows you to make your terminal beep. It can be useful for alerting users to certain events or conditions in a command-line application.
What are beeper's main functionalities?
Single Beep
This feature allows you to make a single beep sound in the terminal. The code sample demonstrates how to import the 'beeper' package and call it to produce a beep.
const beeper = require('beeper');
beeper();
Multiple Beeps
This feature allows you to make multiple beep sounds in the terminal. The code sample demonstrates how to import the 'beeper' package and call it with a number to produce that many beeps.
const beeper = require('beeper');
beeper(3);
Custom Beep Patterns
This feature allows you to create custom beep patterns using a string of asterisks and hyphens. The code sample demonstrates how to import the 'beeper' package and call it with a string pattern to produce a custom sequence of beeps.
const beeper = require('beeper');
beeper('****-*-*');
Other packages similar to beeper
node-notifier
The 'node-notifier' package allows you to send cross-platform notifications from your Node.js applications. While it is more focused on visual notifications, it can also produce sound alerts, making it a more versatile but complex alternative to 'beeper'.
cli-alerts
The 'cli-alerts' package provides a way to display different types of alerts (info, success, warning, error) in the terminal. It includes sound alerts as part of its functionality, offering a more comprehensive alerting system compared to 'beeper'.
beeper
Make your terminal beep
Useful as an attention grabber. For example, when an error happens.
Install
$ npm install beeper
Usage
import beeper from 'beeper';
await beeper();
await beeper(3);
await beeper('****-*-*');
API
It will not beep if stdout is not TTY or if the user supplies the --no-beep
flag.
beeper(count?)
beeper(melody?)
Returns a Promise<void>
that is resolved after the melody has ended.
count
Type: number
Default: 1
How many times you want it to beep.
melody
Type: string
Construct your own melody by supplying a string of *
for beep -
for pause.