Coder Social home page Coder Social logo

zacanger / alert Goto Github PK

View Code? Open in Web Editor NEW
27.0 3.0 5.0 1.03 MB

Cross-platform, isomorphic alert, for Node and browser (previously alert-node)

License: MIT License

JavaScript 96.97% VBScript 3.03%
linux windows mac cross-platform node alert cli console cscript dialog

alert's Introduction

npx zacanger

------------------------------------------
Zac Anger
Senior Software Engineer
------------------------------------------
Web: https://zacanger.com
Resume: https://zacanger.com/resume
GitHub: https://github.com/zacanger
------------------------------------------

LICENSE

alert's People

Contributors

dependabot[bot] avatar picakciali avatar yakkomajuri avatar zacanger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

alert's Issues

Feature Request: Add option to suppress alert in testing

First of all, thanks for the work! The package helps me a lot!

I'm building a website with Node.js and have recently come across the "issue" that when I run mocha tests, alerts fire on top of the code editor which is rather annoying. I'm using alerts to express errors in the user registration process, which I test quite thoroughly, and, as a result, get a bunch of alerts from it that I have to manually close.

I've fixed the issue for myself with my own little wrapper:

const alert = require('alert');

var generateAlert = module.exports = function(msg) {
    if (process.env.NODE_ENV == "development") {
        alert(msg);
    }
}

When testing, I set NODE_ENV to test which suppresses the alert.

So I was thinking of building a feature where a user can pass options to alert() to determine in which environments alert should or should not fire. thingToUse could also be an option, and not setting the options parameter would of course not change anything.

Something like:

alert("Username already in use", { thingToUse: "yad", env: ["development", "production"]})

It would then read from process.env.NODE_ENV to find the value set by the user.

Wondering if this is of interest or if it just adds unnecessary size to the package. If it is, I'll get on it right away!

Cheers!

Consider name change

The alert package is owned by @iclanzan. I tweeted them to see if they would hand that over, since there's no code there. If not, switching to isomorphic-alert or similar might be nice.

Could not see proper notification using 'notify-send' in KDE plasma

Possible bug.
Tried executing following code snippet:

var alert = require('alert-node');
alert('Hello world', 'notify-send');

Expected behavior:
It should have displayed the KDE styled notification

Observed behavior:
Default notification box appeared with provided text.

Environment info (relevant info only):

  System:
    OS: Linux 5.4 Manjaro Linux
    Shell: 5.0.11 - /bin/bash
  Binaries:
    Node: 13.3.0 - /usr/bin/node
    npm: 6.13.4 - /usr/bin/npm

Add Title Support?

At the moment, the alert window (at least on macOS) shows only the message.
Is it (or would it be) possible to give an option to also add a title to be logged or shown in the alert?

Thank you ๐ŸŒธ.

Add more modern options

  • Mac notification center
  • Windows toasters
  • Windows taskbar
  • notify-osd
  • Growl

These are all handled in this library, which does not handle any of the options alert-node handles. They should be considered higher priority/preference than the current options.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.