🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

anybar-webpack

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

anybar-webpack - npm Package Compare versions

Comparing version

to
1.2.0

6

CHANGELOG.md

@@ -13,1 +13,7 @@ ## 1.0.6

- Show compilation error notification using `node-notifier`
## 1.2.0
Changed:
- Notifications are disabled by default. Enable by passing options object with field `enableNotifications: true`.

29

lib/index.js

@@ -10,15 +10,30 @@ var anyBarClient = require('./anybar-client');

var AnyBarWebpackPlugin = function (port, host) {
var AnyBarWebpackPlugin = function (port, host, opts) {
var self = this;
var enableNotifications;
opts = opts || {};
if (typeof port === 'object') {
opts = port;
port = undefined;
}
enableNotifications = opts.enableNotifications;
var failBinded = fail.bind(this, port, host);
this.fail = function(projectName, errorName) {
failBinded();
notifier.notify({
title: 'Webpack Build Status',
subtitle: 'Project: ' + projectName,
message: errorName,
icon: path.join(__dirname, 'icons/webpack-fail@2x.png')
});
if (enableNotifications === true) {
notifier.notify({
title: 'Webpack Build Status',
subtitle: 'Project: ' + projectName,
message: errorName,
icon: path.join(__dirname, 'icons/webpack-fail@2x.png')
});
}
};

@@ -25,0 +40,0 @@

{
"name": "anybar-webpack",
"version": "1.1.0",
"version": "1.2.0",
"description": "Webpack build status plugin for menubar status indicator applications",

@@ -5,0 +5,0 @@ "bin": {

@@ -21,2 +21,7 @@ [![npm version](https://badge.fury.io/js/anybar-webpack.svg)](http://badge.fury.io/js/anybar-webpack)

## Known issues
### No notifications when running from tmux
Please, follow [this instructions](https://github.com/julienXX/terminal-notifier/issues/115#issuecomment-104214742). After that, update tmux config: `tmux source-file ~/.tmux.conf`.
## Installation

@@ -40,3 +45,5 @@

plugins: [
new AnyBarWebpackPlugin()
new AnyBarWebpackPlugin({
enableNotifications: true
})
]

@@ -49,8 +56,8 @@ // ...

### `new AnyBarWebpackPlugin([port [, host]])`
### `new AnyBarWebpackPlugin([port][, host][, options])`
All arguments are optional. If you want to pass the `host` argument, you need to pass a `port` first.
### `port`
Type: `Number`
Default: `1738`
- Type: `Number`
- Default: `1738`

@@ -60,5 +67,11 @@ The port the status bar application is running on.

### `host`
Type: `String`
Default: `'127.0.0.1'`
- Type: `String`
- Default: `'127.0.0.1'`
The host the status bar application is running on.
### `enableNotifications`
- Type: `Boolean`
- Default: `false`
Enable build errors desktop notifications.