Socket
Socket
Sign inDemoInstall

@elastic/ecs-helpers

Package Overview
Dependencies
Maintainers
57
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elastic/ecs-helpers - npm Package Compare versions

Comparing version 1.1.0 to 2.0.0

2

lib/index.js

@@ -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
}

15

package.json
{
"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 @@

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