Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Readme
Want a notification when your node program has finished executing? Want a beep whenever your program has encountered an error? Ever just wanted your error messages read out? node-sfx
is for you.
Install sfx
via npm.
npm install sfx
And require it in your program.
var sfx = require("sfx");
sfx
aims to provide a simple, consistent, cross-platformish API for your sound effects in your node programs.
sfx.play( sound [, volume, rate, callback] )
Play a sound. sound
is a path to a sound file or a name of sound file in the sounds/
directory (without the extension). Specifiying "random" for the sound
parameter plays a random sound from the library. volume
is a number between 1-100. rate
is the speed the sound effect is played at (experimental). And finally, callback
is called on complete.
sfx.play("/System/Library/Sounds/Ping.aiff");
sfx.play("ping");
sfx.play("ping", 100);
sfx.say( string [, voice, callback] )
(OSX only for now)Use text-to-speech to hear a string spoke aloud. string
is the string to speak. voice
is to specify a voice to speak with. Available voices (OSX only) are: Agnes, Albert, Alex, Bad News, Bahh, Bells, Boing, Bruce, Bubbles, Cellos, Deranged, Fred, Good News, Hysterical, Junior, Kathy, Pipe Organ, Princess, Ralph, Trinoids, Vicki, Victoria, Whisper, Zarvox and "random" to use a random voice.
sfx.say("The human torch was denied a bank loan.");
sfx.say("The arsonist has oddly shaped feet.", "Hysterical");
sfx.say("The skeleton ran out of shampoo in the shower.", "random");
sfx.[sound]( [volume, rate] )
Sounds in the library (without their extension) can also be called directly from the sfx
for easy access. sound
is the name of sound within the sound/
library.
sfx.ping();
sfx.hero();
sfx.random(); // Play a random sound
Use sfx
to read out your logs (but it's probably a bad idea).
var _log = console.log;
console.log = function() { sfx.say(Array.prototype.join.call(arguments, ". ")); _log.apply(console, arguments); }
Make sfx
dunk on an error.
db.on("error", function(err) {
sfx.funk(function() {
throw err;
});
});
Have a nice alert when your script is finished running.
operation.on("complete", function() {
sfx.pop(function() {
process.exit();
})
});
Your website's traffic is fading and every request is a good request so it should have a happy sound.
app.get("/", function(req, res) {
sfx.hero();
});
Got any cool examples? Submit a pull request and I'd be happy to put it here.
Have a cool sound to contribute? Make sure it's less than 250kb, stick it in the sounds/
directory and submit a pull request.
sfx add hooray
which adds the hooray
sound to the global sfx sound directory. Sound files could get large and ain't nobody got time for that.MIT
The sounds within the sounds/
directory are the factory sounds provided in /System/Library/Sounds
in OSX. I have no idea what the licensing on these sounds. If anyone can inform me of the license, it would be greatly appreciated.
FAQs
Sound effects for your node programs
The npm package sfx receives a total of 166 weekly downloads. As such, sfx popularity was classified as not popular.
We found that sfx 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.