npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

notify-manager-electron

v1.5.0

Published

Create beautiful and functional notifications on electron

Downloads

36

Readme

Notify Manager

Info

You can test the library with npm run test or npm run test.reply. And also see the source code of examples

Approximate result:

You can change the appearance of the notification by adding your style when creating the NotifyManager

You can use your own sounds when showing a notification.

Demo

Standart notify

Example: Click

Demo:

https://github.com/zxcnoname666/notify-manager-electron/assets/156155219/57532a45-d0d2-46bf-bf6f-ba21df3a799b

Reply notify

Example: Click

Demo:

https://github.com/zxcnoname666/notify-manager-electron/assets/156155219/3d0215f1-31c1-436f-84c9-48c9bb58573b

How to use

Creating a NotifyManager

// 1 - bottom-right;
// 2 - top-right;
// 3 - top-left;
// 4 - bottom-left;
const _manager = new NotifyManager(1, '/* your custom style */');

Creating a Notify

Basic notify

const notify = new Notify('Title of notify', 'Body of notify. HTML allowed.');

// show notify
_manager.show(notify);

Hook onDestroy of notify

const notify = new Notify('Test notify', 'Test.');

notify.onDestroy(() => console.log('destroyed'));
notify.onDestroy(() => console.log('2nd console log of notify destroy'));

// show notify
_manager.show(notify);

Hook onclick of notify

const notify = new Notify('Click hook', 'Click on the notify.');

// show notify
_manager.show(notify, () => {
    console.log('clicked on the notify');
    //..... other code
});

Open an external link when click on the notify

const { shell } = require('electron');

const notify = new Notify('Click hook', 'Click to open link');

_manager.show(notify, () => shell.openExternal('https://github.com/zxcnoname666/notify-manager-electron'));

Notification with image & custom duration

Recommended image size - 55x55px

const duration = 30; // in seconds
const notify = new Notify('Your App', 'Your beautiful message', duration, 'https://github.com/favicon.ico');

// show notify
_manager.show(notify);

Notify with sound

Attention: It is not recommended to use music playing for a long time. Instead, use sounds up to 10 seconds long.
// url, volume
const sound = new NotifySound('https://github.com/zxcnoname666/repo-files/raw/main/notify-manager-electron/meow1.mp3', 50);

const body = '<span style="color:red !important;">text</span>';
const image = 'https://github.com/zxcnoname666/SoundCloud-Desktop/raw/main/icons/appLogo.png';

const notify = new Notify('notify with sound & html', body, 60, image, sound);

// show notify
_manager.show(notify);

You can also use the file:// protocol as a link (for images and sounds)