@elastic/ecs-helpers
Advanced tools
Comparing version 1.1.0 to 2.0.0
@@ -20,3 +20,2 @@ // Licensed to Elasticsearch B.V. under one or more contributor | ||
const stringify = require('./serializer') | ||
const errorFormatters = require('./error-formatters') | ||
@@ -27,5 +26,4 @@ const httpFormatters = require('./http-formatters') | ||
version: '1.6.0', | ||
stringify, | ||
...errorFormatters, | ||
...httpFormatters | ||
} |
{ | ||
"name": "@elastic/ecs-helpers", | ||
"version": "1.1.0", | ||
"description": "ECS loggers helpers", | ||
"version": "2.0.0", | ||
"description": "ecs-logging-nodejs helpers", | ||
"main": "lib/index.js", | ||
@@ -18,5 +18,7 @@ "files": [ | ||
}, | ||
"homepage": "https://github.com/elastic/ecs-logging-nodejs/blob/master/helpers/README.md", | ||
"homepage": "https://github.com/elastic/ecs-logging-nodejs/blob/main/helpers/README.md", | ||
"scripts": { | ||
"test": "standard && tap --timeout ${TAP_TIMEOUT:-10} test/*.test.js" | ||
"lint": "standard", | ||
"lint:fix": "standard --fix", | ||
"test": "tap --no-check-coverage --timeout ${TAP_TIMEOUT:-10} test/*.test.js" | ||
}, | ||
@@ -26,5 +28,2 @@ "engines": { | ||
}, | ||
"dependencies": { | ||
"fast-json-stringify": "^2.4.1" | ||
}, | ||
"devDependencies": { | ||
@@ -37,4 +36,4 @@ "@hapi/hapi": "^20.1.0", | ||
"standard": "16.x", | ||
"tap": "^14.x" | ||
"tap": "^15.0.10" | ||
} | ||
} |
@@ -5,6 +5,6 @@ <img align="right" width="auto" height="auto" src="https://www.elastic.co/static-res/images/elastic-logo-200.png"> | ||
[![Build Status](https://apm-ci.elastic.co/buildStatus/icon?job=apm-agent-nodejs%2Fecs-logging-nodejs-mbp%2Fmaster)](https://apm-ci.elastic.co/job/apm-agent-nodejs/job/ecs-logging-nodejs-mbp/job/master/) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/) | ||
[![Build Status](https://apm-ci.elastic.co/buildStatus/icon?job=apm-agent-nodejs%2Fecs-logging-nodejs-mbp%2Fmain)](https://apm-ci.elastic.co/job/apm-agent-nodejs/job/ecs-logging-nodejs-mbp/job/main/) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/) | ||
A set of helpers for the ECS logging libraries. You should not directly used | ||
this package, but the [ECS logging libraries](../loggers) instead. | ||
A set of helpers for the other [ecs-logging-nodejs packages](../). You should | ||
not directly use this package. | ||
@@ -23,29 +23,3 @@ ## Install | ||
### `stringify` | ||
Function that serializes (very quickly!) an ECS-format log record object. | ||
```js | ||
const { stringify } = require('@elastic/ecs-helpers') | ||
const ecs = { | ||
'@timestamp': new Date().toISOString(), | ||
'log.level': 'info', | ||
message: 'hello world', | ||
log: { | ||
logger: 'test' | ||
}, | ||
ecs: { | ||
version: '1.4.0' | ||
} | ||
} | ||
console.log(stringify(ecs)) | ||
``` | ||
Note: This uses [fast-json-stringify](https://github.com/fastify/fast-json-stringify) | ||
for serialization. By design this chooses speed over supporting serialization | ||
of objects with circular references. This generally means that ecs-logging-nodejs | ||
libraries will throw a "Converting circular structure to JSON" exception if an | ||
attempt is made to log an object with circular references. | ||
### `formatError(obj, err) -> bool` | ||
@@ -52,0 +26,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
0
24644
6
203
161
- Removedfast-json-stringify@^2.4.1
- Removedajv@6.12.6(transitive)
- Removeddeepmerge@4.3.1(transitive)
- Removedfast-deep-equal@3.1.3(transitive)
- Removedfast-json-stable-stringify@2.1.0(transitive)
- Removedfast-json-stringify@2.7.13(transitive)
- Removedjson-schema-traverse@0.4.1(transitive)
- Removedpunycode@2.3.1(transitive)
- Removedrfdc@1.4.1(transitive)
- Removedstring-similarity@4.0.4(transitive)
- Removeduri-js@4.4.1(transitive)