# connect-node

> a simple JSON logging library for node.js services

Latest version **0.0.2** (published 2018-03-08) · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2018-03-08 |
| First published | 2018-03-07 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4.2.4 |
| Dependencies | 0 |
| Unpacked size | 39.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Laurence Ho |
| Maintainers | clearpoint-connect |
| Keywords | log, logging, json |

## Links

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

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.0.2 (latest) — 2018-03-08
- 0.0.1 — 2018-03-07
- 0.0.0 — 2018-03-07

## README

# connect-node
All nodejs artifacts related to the Connect project.

## Description
It is a simple and JSON library for node.js services to print out log in JSON format for elastic search.

Initial logger:
```js
const logger = require('connect-node').createLogger({appName: 'dashboard'}); // appName is required
logger.info('hello, clearpoint-connect!');
```

## Installation Instructions
```sh
$ npm install connect-node
```

## Logger Level
trace, debug, info, warn and error

## Logger API
```js
logger.log(LOG_LEVEL, MESSAGE, PAYLOAD); // LOG_LEVEL must be string
logger.trace( MESSAGE, PAYLOAD); // The MESSAGE(first) field is required, the second field can be optional
logger.debug( MESSAGE, PAYLOAD);
logger.info( MESSAGE, PAYLOAD);
logger.warn( MESSAGE, PAYLOAD);
logger.error( MESSAGE, PAYLOAD);
```
Example 1:
```js
logger.trace('hello, clearpoint-connect!');
````
Output will be like:
```js
{
	"appName":"dashboard",
	"priority":"REST",
	"message":"hello, clearpoint-connect!"
}
```

Example 2:
```js
logger.log('VERBOSE', 'hello, clearpoint-connect!');
````
Output will be like:
```js
{
	"appName":"dashboard",
	"priority":"VERBOSE",
	"message":"hello, clearpoint-connect!"
}
```

Example 3:
```js
logger.trace('Send POST request', {url: 'https://www.google.com', method: 'POST', status: 200});
````
Output will be like:
```js
{
	"appName":"dashboard",
	"priority":"REST",
	"message":"Send POST request",
	"payload":"{\"status\":200,\"url\":\"https://www.google.com\",\"method\":\"POST\"}"
}
```

![connect](http://website.clearpoint.co.nz/connect/connect-logo-on-white-border.png)

[Connect](http://connect.cd) is a Continuous Delivery Platform that gathers best practice approaches for deploying working software into the cloud with confidence.

The main documentation for [Connect](http://connect.cd) can be found at [docs.connect.cd](http://docs.connect.cd)

Any queries on the [Connect](http://connect.cd) platform can be sent to: connect@clearpoint.co.nz

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