gitmyhub

push.js

JavaScript ★ 8.7k updated 2y ago ▣ archived

The world's most versatile desktop notifications framework :earth_americas:

A small JavaScript library that lets websites show desktop notification popups in any browser without writing separate code for Chrome, Firefox, or Safari.

JavaScriptsetup: easycomplexity 2/5

Push.js is a small JavaScript library that makes it straightforward to show desktop notification popups from a web page. When a website wants to alert you about a new message or an event, it can use the browser's built-in Notification API to show a small popup in the corner of your screen, even when the browser tab is in the background. Push.js wraps that browser API so you do not have to write different code for each browser.

The cross-browser problem it solves is real: Chrome, Firefox, Safari, and older versions of Internet Explorer all implemented notifications slightly differently at different times. Push.js handles those differences internally and falls back to older approaches when a browser does not support the current standard. From your code, you just call Push and it figures out the right method to use.

Installing it is simple: one line with npm or Bower, and then you can send a desktop notification with a short function call. Full documentation is available on the project's website at pushjs.org.

The library is in a low-activity maintenance state. The original author notes that he is occupied with other work and is looking for co-maintainers to help answer questions and fix bugs. The core functionality is stable and the library still works, but active development has slowed. If you need desktop notifications in a JavaScript project and want something that requires almost no setup, this library does that job. If you are starting something new and need long-term support guarantees, the README suggests checking whether a co-maintainer has stepped in since this was written.

Where it fits