Coder Social home page Coder Social logo

ahendri / electron-notification-desktop Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hutx/electron-notification-desktop

0.0 1.0 0.0 58 KB

A node module for sending desktop notification in electron applications

License: MIT License

JavaScript 73.25% CSS 21.24% HTML 5.50%

electron-notification-desktop's Introduction

Electron Notifications

A node module for sending desktop notification in electron applications.

screenshot

Quick Usage

const notifier = require('electron-notfier-desktop')

// Just title
notifier.notify('Notification Title')

// Full Options
notifier.notify('Notification Title', {
  message: 'This is the content of the notification. This is the content of the notification. This is the content of the notification.',
})

Installation

npm install --save electron-notification-desktop

Introduction

When you create a new notification, your notification is queued, since we only display one at a time. Each notification is a BrowserWindow instance, so it's completely cross platform.

Options

All options are optional.

  • message: A message to display under the title.
  • icon: The absolute URL of a icon displayed to the left of the text ,image size 85px* 85px.
  • duration: A notification is closed after 4.5s by default. When specifying duration to null or 0, it will never be closed automatically.

Duration after which the notification is closed

const notification = notifier.notify('Notification Title',{
  message:'I will never close automatically. I will be close automatically. I will never close automatically.',
   duration: 0,
  })

Events

In addition to the events provided by electron you also have access to the following additional events.

Clicked

When the notification was clicked, but not dragged. This usually does the default action, or closes the notification.

const notification = notifier.notify('Notification Title',{
  message:'This is the content of the notification. This is the content of the notification. This is the content of the notification.'
  })

notification.on('clicked', () => {
  notification.close()
})

electron-notification-desktop's People

Watchers

Achim Hendriks avatar

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.