New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bunyamin

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bunyamin - npm Package Compare versions

Comparing version 0.0.1 to 1.0.0

dist/decorator/Bunyamin.d.ts

70

package.json
{
"name": "bunyamin",
"version": "0.0.1",
"version": "1.0.0",
"description": "Bunyan-based logger for Node.js supporting Trace Event format",

@@ -21,6 +21,72 @@ "license": "MIT",

},
"files": ["docs", "!*.{jpg,svg,png}"],
"engines": {
"node": ">=14.18.2"
},
"main": "dist/index.js",
"module": "dist/index.esm.js",
"typings": "./dist/index.d.ts",
"files": [
"src",
"dist",
"!**/__mocks__",
"!**/__tests__",
"!**/__utils__",
"!**/*.test.*"
],
"scripts": {
"prepare": "husky install",
"clean": "git clean -xdf",
"build": "microbundle src/index.ts --target node --format cjs,es",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"lint:staged": "lint-staged",
"test": "jest"
},
"devDependencies": {
"@commitlint/cli": "^17.6.1",
"@commitlint/config-conventional": "^17.6.1",
"@types/bunyan": "^1.8.8",
"@types/stream-json": "^1.7.3",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"bunyan": "^1.8.15",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.39.0",
"eslint-config-prettier": "^8.8.0",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsdoc": "^43.1.1",
"eslint-plugin-no-only-tests": "^3.1.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-unicorn": "^46.0.0",
"husky": "^8.0.3",
"jest": "^29.0.0",
"lint-staged": "^13.2.2",
"microbundle": "^0.15.1",
"prettier": "^2.8.8",
"semantic-release": "^21.0.2",
"tempy": "^1.0.0",
"ts-jest": "^29.1.0",
"typedoc": "^0.24.6",
"typescript": "^5.0.4"
},
"dependencies": {
"@flatten-js/interval-tree": "^1.0.20",
"multi-sort-stream": "^1.0.4",
"stream-json": "^1.7.5",
"trace-event-lib": "^1.3.1"
},
"peerDependencies": {
"bunyan": "^1.8.15",
"@types/bunyan": "^1.8.8"
},
"peerDependenciesMeta": {
"bunyan": {
"optional": true
},
"@types/bunyan": {
"optional": true
}
}
}

27

README.md

@@ -35,11 +35,19 @@ <table align=center><tr><td rowspan=2 width="355px">

```js
import { createLogger, traceEventStream } from 'bunyamin';
import { createLogger } from 'bunyan';
import { wrapLogger, traceEventStream } from 'bunyamin';
const logger = createLogger({
const bunyan = createLogger({
name: 'my-app',
streams: [
traceEventStream({ outFile: '/path/to/trace.json', loglevel: 'trace' }),
{
level: 'trace',
stream: traceEventStream({
filePath: '/path/to/trace.json',
loglevel: 'trace',
}),
}
],
});
const logger = wrapLogger({ logger: bunyan });
logger.info('Hello, world!');

@@ -108,9 +116,7 @@ ```

type LogEvent = {
id?: string | number;
cat?: string | string[];
cname?: string;
pid?: never;
tid?: never;
ts?: never;
ph?: never;
pid?: number;
tid?: number | string | [string, unknown];
[customProperty: string]: unknown;

@@ -120,7 +126,8 @@ };

The `id` property can be used to assign an ID to the event, which can be helpful when logging concurrent or overlapping events.
The `tid` property can be used to assign an explicit thread id to the event or a thread alias,
which can be helpful when logging concurrent or overlapping events.
### Child Loggers
You can create a child logger with a specific context by calling the `child` method on the parent logger:
Similar to Bunyan, you can create a child logger with a specific context by calling the `child` method on the parent logger:

@@ -127,0 +134,0 @@ ```js

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