Code Monkey home page Code Monkey logo

trayballoon's Introduction

trayballoon

Create a trayballoon on Windows

Install

$ npm install trayballoon

Usage

import trayballoon from 'trayballoon';

await trayballoon({
	text: 'Unicorns & rainbows',
	icon: 'ponies.ico',
	timeout: 20000
});

console.log('Trayballoon disappeared');

API

trayballoon(options)

Return a promise that resolves when the trayballon disappears.

options

Type: object

text

Required
Type: string

The body text.

title

Type: string

The title text.

icon

Type: string

The path to a .ico file or a .exe/.dll file with icon resource index (eg: shell32.dll,-154).

timeout

Type: number
Default: 5000

The duration to show the balloon in milliseconds.

CLI

$ npm install --global trayballoon
$ trayballoon --help

  Usage
    trayballoon <text>
    echo <text> | trayballoon

  Example
    trayballoon unicorns --title rainbows --icon ponies.ico

  Options
    --title    Title of the balloon
    --icon     Path to a .ico file or .exe/.dll file with icon resource index
    --timeout  Time to show the balloon in milliseconds
    --wait     Wait for the balloon to disappear

trayballoon's People

Contributors

kevva avatar richienb avatar seriousmanual avatar sindresorhus 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

trayballoon's Issues

Support buffer in the `icon` option

Would be handy to support a buffer with raw bitmap and PNG that is constructed on the fly to a .ico file and put in a temp dir. Could then easily support PNG file input data.

callback behaviour

First of all, thanks for this small but very charming tool!

The callback behavior looks... counter-intuitive. It is called almost instantly even with wait: true.

I want to propose a breaking API change that (hopefully) would make API easier to understand and to maintain. As for me, wait option is useless at all. If coders wants to open balloon asynchronously with code running on, they should leave wait: false and wrap their code into a callback …or just don't use a callback at all and write lines of code after call, it would behave just the same.

So if there's no wait option (and code works as if it was set), there's no need for unref/setImmediate black magic: If we set a callback, we're expecting it to be called, so interpreter should not be stopped; if we didn't set a callback, unref it and "forget" it.

Unable to get spec description

Hi @sindresorhus ,
I'm using this npm since long back successfully with Jasmine v1. Recently I've upgraded to Jasmine v2 and now, I'm unable to get the spec description as text of my traybaloon since there is a limitation in Jasmine v2.
Do you have any solution which overcomes this problem.

Thanks in advance.

tray balloon doesn't get disappear after specified timeout

Hi There,

Am using trayballoon npm for more than a year, and I have an issue where tray balloon stays on task bar forever until closed manually. Below is my implementation of trayballoon code

 specStarted: function(result) {
            trayballoon({
                title: 'Currently Running Test Case',
                text: result.description,
                icon: '.\\resources\\image-library\\protractor.ico',
                timeout: 2000,
                wait : 2000
            },function(){
                console.log("")
            });
        }

here trayballoon waits for more than 10 + sec or waits on taskbar forever.

ENV details:
Platform win 10:
nodejs : 6.11.4

Please help to resolve this issue. Thanks in advance

Thanks,
Sri Harsha
@npm: www.npmjs.com/~sriharsha

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.