Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hyper-notifier

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyper-notifier - npm Package Compare versions

Comparing version 1.0.2 to 1.0.4

37

index.js
const notifier = require('node-notifier');
let notifications = []
let newConfig = {}
let defaultConfig = {
registered: false,
sound: 'Basso'
}
let notifierString;
exports.onApp = registerConfigs
exports.middleware = (store) => (next) => (action) => {

@@ -14,13 +12,8 @@ if ('SESSION_PTY_DATA' === action.type) {

if (isNotifierString(data)) {
// load user configs
if(!defaultConfig.registered) {
defaultConfig = registerConfigs()
// load notificaion configs
const instanceOverrides = findNotifierString(data)
if(instanceOverrides) {
notifier.notify(instanceOverrides);
}
const instanceOverrides = findNotifierString(data) || {}
notifier.notify({
...defaultConfig,
...instanceOverrides
});
}

@@ -35,3 +28,3 @@ next(action);

function isNotifierString(data) {
return new RegExp('(' + notifications.map(n => n.test).join(')|(') + ')').test(data)
return new RegExp('(' + notifierString + ')').test(data)
}

@@ -47,7 +40,5 @@

const notifierConfigs = config.getConfig().hyperNotifier
if(notifierConfigs.settings) {
newConfig = {
...notifierConfigs,
registered: true
}
if(notifications.length > 0 && !notifierString) {
return
}

@@ -59,3 +50,5 @@

return {...defaultConfig, ...newConfig}
if (!notifierString) {
notifierString = notifications.map(n => n.test).join(')|(')
}
}
{
"name": "hyper-notifier",
"version": "1.0.2",
"version": "1.0.4",
"description": "A notifications and alerting plugin for Hyper.js",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -13,3 +13,3 @@ # hyper-notifier

```
Then register your base settings (optional) and notifications (required) in your `.hyper.js`
Then register your notifications in your `.hyper.js`

@@ -20,5 +20,2 @@ ```

hyperNotifier: {
settings: {
sound: 'Funk'
},
notifications: [

@@ -28,3 +25,4 @@ {

title: 'ERR! was detected!', // node-notifier config
message: 'check hyperterm' // node-notifier config
message: 'check hyperterm', // node-notifier config
sound: 'Funk',
}

@@ -31,0 +29,0 @@ ]

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc