sindresorhus / beeper Goto Github PK
View Code? Open in Web Editor NEWMake your terminal beep
License: MIT License
Make your terminal beep
License: MIT License
I use beeper before I call process.exit()
.
Because of beeper's setTimeout()
s, if I require('beeper')(5); process.exit();
I only hear one beep. This is on Windows, by the way.
If beeper checked for the last element in arguments
being a function and treated that like a callback, I could do this, and hear 5 beeps:
require('beeper')(5, function() {
process.exit();
});
Alternatively, beeper could return a promise so I could instead do:
`require('beeper')(5).then(process.exit);`
I can submit a PR if this idea is tenable.
From my experience, the BELL character doesn't really work in cmd. An alternative is to execute rundll32 user32.dll,MessageBeep
to do the same thing.
Hi, I just installed this package into my fresh nodejs app using
node/18.13.0
"esm": "^3.2.25"
Im getting the following error:
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/{my path}/api/node_modules/beeper/index.js not supported.
Instead change the require of index.js in null to a dynamic import() which is available in all CommonJS modules.
I am getting following error
Error transforming /home/travis/build/GeekAb/picker.js/node_modules/beeper/index.js with 'commonjs' plugin: 'return' outside of function (9:1) in /home/travis/build/GeekAb/picker.js/node_modules/beeper/index.js
[08:58:22] 'rollup:iife' errored after 5.63 s
[08:58:22] SyntaxError: Error transforming /home/travis/build/GeekAb/picker.js/node_modules/beeper/index.js with 'commonjs' plugin: 'return' outside of function (9:1) in /home/travis/build/GeekAb/picker.js/node_modules/beeper/index.js
This works like a charm.
Thanks for the support.
If this beeper got volume control, it would be perfect.
Thanks.
The following Morse code beep using the glass tone doesn't work correctly as there is a problem if a beep tone takes longer than 500ms
beeper('----***')
It seems that the pause happens while the sample bell is playing - instead perhaps the pause should happen after the sample plays (?)
Is it possible to clear the red "1" badge on MacOS's Terminal app when my build has been successful? Often I instantly know why I made a syntax error and it would be nice to not have to actively go into the Terminal app to clear the badge when I don't have to.
[16:25:30] SyntaxError: /Users/nackjicholson/repos/dynamoDb-marshaler/node_modules/gulp-mocha/node_modules/gulp-util/node_modules/beeper/index.js: 'return' outside of function (9:1)
7 | process.argv.indexOf('--beep=false') !== -1) {
8 | module.exports = function () {};
> 9 | return;
| ^
10 | }
11 |
12 | function beep() {
This is running iojs v1.8.1
I have tried to use this both with node and ts-node and always get "Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/user/code/testing-beeper/node_modules/beeper/index.js"
This is my tests file
import beeper from 'beeper';
beeper().then(
() => { console.log('DONE'); },
(error) => {
console.log(error);
process.exit(1);
}
);
I'm probably doing something wrong, but I can not figure it out.
This test does not check that there are 3 beeps.
The test suite passes both before my pull request #6 and after, even though it beeps twice before and three times after.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.