# node-notifyy

> Send node application errors to Telegram using Notifyy-McNotifyFace

Latest version **3.1.0** (published 2018-07-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-notifyy
pnpm add node-notifyy
yarn add node-notifyy
bun add node-notifyy
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.1.0 |
| Published | 2018-07-20 |
| First published | 2016-09-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | ^6.5.0 |
| Dependencies | 0 |
| Unpacked size | 7.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kokarn |
| Maintainers | kokarn |
| Keywords | telegram, notifyy, error, logging |

## Links

- npm: https://www.npmjs.com/package/node-notifyy
- Repository: https://kokarn@github.com/kokarn/node-notifyy
- Homepage: https://github.com/kokarn/node-notifyy#readme
- Issues: https://github.com/kokarn/node-notifyy/issues
- npm.io page: https://npm.io/package/node-notifyy

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 3.1.0 (latest) — 2018-07-20
- 3.0.0 — 2018-07-09
- 2.0.0 — 2018-07-09
- 1.0.0 — 2016-09-14

## README

# Node-Notifyy

Module to send error messages to you on Telegram using [Notifyy-McNotifyFace](http://notifyy-mcnotifyface.herokuapp.com/).

## Installing

```zh
npm i node-notifyy
```

## Constructor options
`users`  
String or array with the tokens for the users we should notify.

`title`   
A default title for your messages.  
E.g `Application crashed` or `We've been overrun by sub-atomic monkeys!`

`handleErrors`  
Default: `false`  
Enable this if you want to catch all errors globally and send notifications for them.  
Use with caution as this might intercept other error handlers in some situations.

## Methods

`send`  
Sends a notification.  
Returns a Promise

### Available parameters

| Key          | Required            | Type               |
|--------------|---------------------|--------------------|
| title        | YES (if no message) | string             |
| message      | YES (if no title)   | string             |
| url          | NO                  | url-encoded string |
| code         | NO                  | string             |
| notification | NO                  | boolean            |

## Examples

Send a message

```javascript
const Notifyy = require( 'node-notifyy' );
let notifyy = new Notifyy( {
    users: '*TOKEN*'
} );

notifyy.send( {
    message: 'My message contents',
    title: 'My message title',
} );

```
Send a message without notification

```javascript
const Notifyy = require( 'node-notifyy' );
let notifyy = new Notifyy( {
    users: '*TOKEN*'
} );

notifyy.send( {
    message: 'My message contents',
    title: 'My message title',
    notification: false,
} );
```

Use as a notification for a single try/catch

```javascript
const Notifyy = require( 'node-notifyy' );
let notifyy = new Notifyy( {
    users: '*TOKEN*'
} );

try {
    undefinedMethod();
} catch ( error ) {
    notifyy.send( {
        message: error.message,
        code: error.stack,
    } );
}
```

With shorthand for standard errors

```javascript
const Notifyy = require( 'node-notifyy' );
let notifyy = new Notifyy({
    users: '*TOKEN*'
});

try {
    undefinedMethod();
} catch ( error ) {
    notifyy.send( error );
}
```

Use to catch all errors

```javascript
const Notifyy = require( 'node-notifyy' );
let notifyy = new Notifyy( {
    users: '*TOKEN*',
    handleErrors: true,
} );

undefinedMethod();
```

---
_Source: https://npm.io/package/node-notifyy · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
