node-mongo-orm 0.0.1-security → 3.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of node-mongo-orm might be problematic. Click here for more details.

Files changed (200) hide show
  1. package/.eslintignore +2 -0
  2. package/.eslintrc +8 -0
  3. package/.github/dependabot.yml +13 -0
  4. package/.github/workflows/bench.yml +61 -0
  5. package/.github/workflows/ci.yml +88 -0
  6. package/.github/workflows/lock-threads.yml +30 -0
  7. package/.github/workflows/target-main.yml +23 -0
  8. package/.nojekyll +0 -0
  9. package/.prettierignore +1 -0
  10. package/.taprc.yaml +8 -0
  11. package/CNAME +1 -0
  12. package/CONTRIBUTING.md +30 -0
  13. package/LICENSE +21 -0
  14. package/README.md +159 -3
  15. package/SECURITY.md +68 -0
  16. package/benchmarks/basic.bench.js +95 -0
  17. package/benchmarks/child-child.bench.js +52 -0
  18. package/benchmarks/child-creation.bench.js +73 -0
  19. package/benchmarks/child.bench.js +62 -0
  20. package/benchmarks/deep-object.bench.js +88 -0
  21. package/benchmarks/formatters.bench.js +50 -0
  22. package/benchmarks/internal/custom-levels.js +67 -0
  23. package/benchmarks/internal/just-pino-heavy.bench.js +76 -0
  24. package/benchmarks/internal/just-pino.bench.js +182 -0
  25. package/benchmarks/internal/parent-vs-child.bench.js +75 -0
  26. package/benchmarks/internal/redact.bench.js +86 -0
  27. package/benchmarks/long-string.bench.js +81 -0
  28. package/benchmarks/multi-arg.bench.js +193 -0
  29. package/benchmarks/multistream.js +98 -0
  30. package/benchmarks/object.bench.js +82 -0
  31. package/benchmarks/utils/generate-benchmark-doc.js +36 -0
  32. package/benchmarks/utils/runbench.js +138 -0
  33. package/benchmarks/utils/wrap-log-level.js +55 -0
  34. package/bin.js +6 -0
  35. package/browser.js +484 -0
  36. package/build/sync-version.js +10 -0
  37. package/docs/api.md +1487 -0
  38. package/docs/asynchronous.md +40 -0
  39. package/docs/benchmarks.md +55 -0
  40. package/docs/browser.md +227 -0
  41. package/docs/bundling.md +40 -0
  42. package/docs/child-loggers.md +95 -0
  43. package/docs/ecosystem.md +84 -0
  44. package/docs/help.md +345 -0
  45. package/docs/lts.md +64 -0
  46. package/docs/pretty.md +35 -0
  47. package/docs/redaction.md +135 -0
  48. package/docs/transports.md +1238 -0
  49. package/docs/web.md +269 -0
  50. package/docsify/sidebar.md +26 -0
  51. package/examples/basic.js +43 -0
  52. package/examples/transport.js +68 -0
  53. package/favicon-16x16.png +0 -0
  54. package/favicon-32x32.png +0 -0
  55. package/favicon.ico +0 -0
  56. package/file.js +12 -0
  57. package/inc-version.sh +42 -0
  58. package/index.html +55 -0
  59. package/lib/caller.js +30 -0
  60. package/lib/constants.js +28 -0
  61. package/lib/deprecations.js +8 -0
  62. package/lib/levels.js +241 -0
  63. package/lib/meta.js +3 -0
  64. package/lib/multistream.js +188 -0
  65. package/lib/proto.js +234 -0
  66. package/lib/redaction.js +118 -0
  67. package/lib/symbols.js +74 -0
  68. package/lib/time.js +11 -0
  69. package/lib/tools.js +394 -0
  70. package/lib/transport-stream.js +56 -0
  71. package/lib/transport.js +167 -0
  72. package/lib/worker.js +194 -0
  73. package/lib/writer.js +42 -0
  74. package/package.json +117 -3
  75. package/pino-banner.png +0 -0
  76. package/pino-logo-hire.png +0 -0
  77. package/pino-tree.png +0 -0
  78. package/pino.d.ts +889 -0
  79. package/pino.js +236 -0
  80. package/pretty-demo.png +0 -0
  81. package/test/basic.test.js +874 -0
  82. package/test/broken-pipe.test.js +57 -0
  83. package/test/browser-child.test.js +132 -0
  84. package/test/browser-disabled.test.js +87 -0
  85. package/test/browser-early-console-freeze.test.js +12 -0
  86. package/test/browser-levels.test.js +241 -0
  87. package/test/browser-serializers.test.js +352 -0
  88. package/test/browser-timestamp.test.js +88 -0
  89. package/test/browser-transmit.test.js +417 -0
  90. package/test/browser.test.js +659 -0
  91. package/test/complex-objects.test.js +34 -0
  92. package/test/crlf.test.js +32 -0
  93. package/test/custom-levels.test.js +253 -0
  94. package/test/error.test.js +398 -0
  95. package/test/errorKey.test.js +34 -0
  96. package/test/escaping.test.js +91 -0
  97. package/test/esm/esm.mjs +12 -0
  98. package/test/esm/index.test.js +34 -0
  99. package/test/esm/named-exports.mjs +27 -0
  100. package/test/exit.test.js +77 -0
  101. package/test/fixtures/broken-pipe/basic.js +9 -0
  102. package/test/fixtures/broken-pipe/destination.js +10 -0
  103. package/test/fixtures/broken-pipe/syncfalse.js +12 -0
  104. package/test/fixtures/console-transport.js +13 -0
  105. package/test/fixtures/default-exit.js +8 -0
  106. package/test/fixtures/destination-exit.js +8 -0
  107. package/test/fixtures/eval/index.js +13 -0
  108. package/test/fixtures/eval/node_modules/14-files.js +3 -0
  109. package/test/fixtures/eval/node_modules/2-files.js +3 -0
  110. package/test/fixtures/eval/node_modules/file1.js +5 -0
  111. package/test/fixtures/eval/node_modules/file10.js +5 -0
  112. package/test/fixtures/eval/node_modules/file11.js +5 -0
  113. package/test/fixtures/eval/node_modules/file12.js +5 -0
  114. package/test/fixtures/eval/node_modules/file13.js +5 -0
  115. package/test/fixtures/eval/node_modules/file14.js +11 -0
  116. package/test/fixtures/eval/node_modules/file2.js +5 -0
  117. package/test/fixtures/eval/node_modules/file3.js +5 -0
  118. package/test/fixtures/eval/node_modules/file4.js +5 -0
  119. package/test/fixtures/eval/node_modules/file5.js +5 -0
  120. package/test/fixtures/eval/node_modules/file6.js +5 -0
  121. package/test/fixtures/eval/node_modules/file7.js +5 -0
  122. package/test/fixtures/eval/node_modules/file8.js +5 -0
  123. package/test/fixtures/eval/node_modules/file9.js +5 -0
  124. package/test/fixtures/noop-transport.js +10 -0
  125. package/test/fixtures/pretty/null-prototype.js +8 -0
  126. package/test/fixtures/stdout-hack-protection.js +11 -0
  127. package/test/fixtures/syncfalse-child.js +6 -0
  128. package/test/fixtures/syncfalse-exit.js +9 -0
  129. package/test/fixtures/syncfalse-flush-exit.js +10 -0
  130. package/test/fixtures/syncfalse.js +6 -0
  131. package/test/fixtures/syntax-error-esm.mjs +2 -0
  132. package/test/fixtures/to-file-transport-with-transform.js +20 -0
  133. package/test/fixtures/to-file-transport.js +13 -0
  134. package/test/fixtures/to-file-transport.mjs +8 -0
  135. package/test/fixtures/transport/index.js +12 -0
  136. package/test/fixtures/transport/package.json +5 -0
  137. package/test/fixtures/transport-exit-immediately-with-async-dest.js +16 -0
  138. package/test/fixtures/transport-exit-immediately.js +11 -0
  139. package/test/fixtures/transport-exit-on-ready.js +12 -0
  140. package/test/fixtures/transport-main.js +9 -0
  141. package/test/fixtures/transport-many-lines.js +29 -0
  142. package/test/fixtures/transport-string-stdout.js +9 -0
  143. package/test/fixtures/transport-transform.js +21 -0
  144. package/test/fixtures/transport-uses-pino-config.js +33 -0
  145. package/test/fixtures/transport-with-on-exit.js +12 -0
  146. package/test/fixtures/transport-worker-data.js +19 -0
  147. package/test/fixtures/transport-worker.js +15 -0
  148. package/test/fixtures/transport-wrong-export-type.js +3 -0
  149. package/test/fixtures/ts/to-file-transport-with-transform.ts +18 -0
  150. package/test/fixtures/ts/to-file-transport.ts +11 -0
  151. package/test/fixtures/ts/transpile.cjs +36 -0
  152. package/test/fixtures/ts/transport-exit-immediately-with-async-dest.ts +15 -0
  153. package/test/fixtures/ts/transport-exit-immediately.ts +10 -0
  154. package/test/fixtures/ts/transport-exit-on-ready.ts +11 -0
  155. package/test/fixtures/ts/transport-main.ts +8 -0
  156. package/test/fixtures/ts/transport-string-stdout.ts +8 -0
  157. package/test/fixtures/ts/transport-worker.ts +14 -0
  158. package/test/formatters.test.js +355 -0
  159. package/test/helper.d.ts +4 -0
  160. package/test/helper.js +128 -0
  161. package/test/hooks.test.js +118 -0
  162. package/test/http.test.js +242 -0
  163. package/test/internals/version.test.js +15 -0
  164. package/test/is-level-enabled.test.js +185 -0
  165. package/test/jest/basic.spec.js +10 -0
  166. package/test/levels.test.js +772 -0
  167. package/test/metadata.test.js +106 -0
  168. package/test/mixin-merge-strategy.test.js +55 -0
  169. package/test/mixin.test.js +218 -0
  170. package/test/multistream.test.js +673 -0
  171. package/test/pkg/index.js +46 -0
  172. package/test/pkg/pkg.config.json +17 -0
  173. package/test/pkg/pkg.test.js +56 -0
  174. package/test/redact.test.js +847 -0
  175. package/test/serializers.test.js +253 -0
  176. package/test/stdout-protection.test.js +39 -0
  177. package/test/syncfalse.test.js +188 -0
  178. package/test/timestamp.test.js +121 -0
  179. package/test/transport/big.test.js +43 -0
  180. package/test/transport/bundlers-support.test.js +97 -0
  181. package/test/transport/caller.test.js +23 -0
  182. package/test/transport/core.test.js +644 -0
  183. package/test/transport/core.test.ts +236 -0
  184. package/test/transport/core.transpiled.test.ts +112 -0
  185. package/test/transport/module-link.test.js +239 -0
  186. package/test/transport/pipeline.test.js +135 -0
  187. package/test/transport/repl.test.js +14 -0
  188. package/test/transport/syncTrue.test.js +55 -0
  189. package/test/transport/syncfalse.test.js +68 -0
  190. package/test/transport/targets.test.js +44 -0
  191. package/test/transport/uses-pino-config.test.js +167 -0
  192. package/test/transport-stream.test.js +26 -0
  193. package/test/types/pino-import.test-d.ts +29 -0
  194. package/test/types/pino-multistream.test-d.ts +28 -0
  195. package/test/types/pino-top-export.test-d.ts +35 -0
  196. package/test/types/pino-transport.test-d.ts +145 -0
  197. package/test/types/pino-type-only.test-d.ts +64 -0
  198. package/test/types/pino.test-d.ts +468 -0
  199. package/test/types/pino.ts +78 -0
  200. package/tsconfig.json +14 -0
package/.eslintignore ADDED
@@ -0,0 +1,2 @@
1
+ pino.d.ts
2
+ test/types/pino.test-d.ts
package/.eslintrc ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": [
3
+ "standard"
4
+ ],
5
+ "rules": {
6
+ "no-var": "off"
7
+ }
8
+ }
@@ -0,0 +1,13 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "monthly"
7
+ open-pull-requests-limit: 10
8
+
9
+ - package-ecosystem: "npm"
10
+ directory: "/"
11
+ schedule:
12
+ interval: "weekly"
13
+ open-pull-requests-limit: 10
@@ -0,0 +1,61 @@
1
+ name: Benchmarks
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+ paths-ignore:
7
+ - 'docs/**'
8
+ - '*.md'
9
+ pull_request:
10
+ paths-ignore:
11
+ - 'docs/**'
12
+ - '*.md'
13
+
14
+ permissions:
15
+ contents: read
16
+
17
+ jobs:
18
+ benchmark_current:
19
+ name: benchmark current
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - name: Checkout Code
23
+ uses: actions/checkout@v4
24
+ with:
25
+ ref: ${{ github.base_ref }}
26
+ persist-credentials: false
27
+ - name: Setup Node
28
+ uses: actions/setup-node@v4
29
+ with:
30
+ node-version: lts/*
31
+ - name: Install Modules
32
+ run: npm i --ignore-scripts
33
+ - name: Run Benchmark
34
+ run: npm run bench | tee current.txt
35
+ - name: Upload Current Results
36
+ uses: actions/upload-artifact@v4
37
+ with:
38
+ name: current
39
+ path: current.txt
40
+
41
+ benchmark_branch:
42
+ name: benchmark branch
43
+ runs-on: ubuntu-latest
44
+ steps:
45
+ - name: Checkout Code
46
+ uses: actions/checkout@v4
47
+ with:
48
+ persist-credentials: false
49
+ - name: Setup Node
50
+ uses: actions/setup-node@v4
51
+ with:
52
+ node-version: lts/*
53
+ - name: Install Modules
54
+ run: npm i --ignore-scripts
55
+ - name: Run Benchmark
56
+ run: npm run bench | tee branch.txt
57
+ - name: Upload Branch Results
58
+ uses: actions/upload-artifact@v4
59
+ with:
60
+ name: branch
61
+ path: branch.txt
@@ -0,0 +1,88 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - 'v*'
8
+ paths-ignore:
9
+ - 'docs/**'
10
+ - '*.md'
11
+ pull_request:
12
+ paths-ignore:
13
+ - 'docs/**'
14
+ - '*.md'
15
+
16
+ # This allows a subsequently queued workflow run to interrupt previous runs
17
+ concurrency:
18
+ group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
19
+ cancel-in-progress: true
20
+
21
+ jobs:
22
+ dependency-review:
23
+ name: Dependency Review
24
+ if: github.event_name == 'pull_request'
25
+ runs-on: ubuntu-latest
26
+ permissions:
27
+ contents: read
28
+ steps:
29
+ - name: Check out repo
30
+ uses: actions/checkout@v4
31
+ with:
32
+ persist-credentials: false
33
+
34
+ - name: Dependency review
35
+ uses: actions/dependency-review-action@v4
36
+
37
+ test:
38
+ name: ${{ matrix.node-version }} ${{ matrix.os }}
39
+ runs-on: ${{ matrix.os }}
40
+ permissions:
41
+ contents: read
42
+ strategy:
43
+ fail-fast: false
44
+ matrix:
45
+ os: [macOS-latest, windows-latest, ubuntu-latest]
46
+ node-version: [18, 20, 22]
47
+ exclude:
48
+ - os: windows-latest
49
+ node-version: 22
50
+
51
+ steps:
52
+ - name: Check out repo
53
+ uses: actions/checkout@v4
54
+ with:
55
+ persist-credentials: false
56
+
57
+ - name: Setup Node ${{ matrix.node-version }}
58
+ uses: actions/setup-node@v4
59
+ with:
60
+ node-version: ${{ matrix.node-version }}
61
+
62
+ - name: Install dependencies
63
+ run: npm i --ignore-scripts
64
+
65
+ - name: Run tests
66
+ run: npm run test-ci
67
+
68
+ - name: Run smoke test
69
+ if: >
70
+ matrix.os != 'windows-latest' &&
71
+ matrix.node-version > 14
72
+ run: npm run test:smoke
73
+
74
+ automerge:
75
+ name: Automerge Dependabot PRs
76
+ if: >
77
+ github.event_name == 'pull_request' &&
78
+ github.event.pull_request.user.login == 'dependabot[bot]'
79
+ needs: test
80
+ permissions:
81
+ pull-requests: write
82
+ contents: write
83
+ runs-on: ubuntu-latest
84
+ steps:
85
+ - uses: fastify/github-action-merge-dependabot@v3
86
+ with:
87
+ github-token: ${{ secrets.GITHUB_TOKEN }}
88
+ exclude: 'sonic-boom,pino-std-serializers,quick-format-unescaped,fast-redact'
@@ -0,0 +1,30 @@
1
+ name: 'Lock Threads'
2
+
3
+ on:
4
+ schedule:
5
+ - cron: '0 0 * * *'
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ issues: write
10
+ pull-requests: write
11
+
12
+ concurrency:
13
+ group: lock
14
+
15
+ jobs:
16
+ action:
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: jsumners/lock-threads@b27edac0ac998d42b2815e122b6c24b32b568321
20
+ with:
21
+ log-output: true
22
+ issue-inactive-days: '30'
23
+ issue-comment: >
24
+ This issue has been automatically locked since there
25
+ has not been any recent activity after it was closed.
26
+ Please open a new issue for related bugs.
27
+ pr-comment: >
28
+ This pull request has been automatically locked since there
29
+ has not been any recent activity after it was closed.
30
+ Please open a new issue for related bugs.
@@ -0,0 +1,23 @@
1
+ name: PR Target Check
2
+
3
+ on:
4
+ pull_request_target:
5
+ types: [opened]
6
+
7
+ permissions:
8
+ pull-requests: write
9
+
10
+ jobs:
11
+ comment:
12
+ if: ${{ github.base_ref != "master" }}
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/github-script@v7
16
+ with:
17
+ script: |
18
+ github.rest.issues.createComment({
19
+ issue_number: context.issue.number,
20
+ owner: context.repo.owner,
21
+ repo: context.repo.repo,
22
+ body: '⚠️ This pull request does not target the master branch.'
23
+ })
package/.nojekyll ADDED
File without changes
@@ -0,0 +1 @@
1
+ *
package/.taprc.yaml ADDED
@@ -0,0 +1,8 @@
1
+ coverage: true
2
+ timeout: 480
3
+ check-coverage: false
4
+
5
+ reporter: terse
6
+
7
+ files:
8
+ - 'test/**/*.test.js'
package/CNAME ADDED
@@ -0,0 +1 @@
1
+ getpino.io
@@ -0,0 +1,30 @@
1
+ # Pino is an OPEN Open Source Project
2
+
3
+ ## What?
4
+
5
+ Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.
6
+
7
+ ## Rules
8
+
9
+ Before you start coding, please read [Contributing to projects with git](https://jrfom.com/posts/2017/03/08/a-primer-on-contributing-to-projects-with-git/).
10
+
11
+ Notice that as long as you don't have commit-access to the project, you have to fork the project and open PRs from the feature branches of the forked project.
12
+
13
+ There are a few basic ground-rules for contributors:
14
+
15
+ 1. **No `--force` pushes** on `master` or modifying the Git history in any way after a PR has been merged.
16
+ 1. **Non-master branches** ought to be used for ongoing work.
17
+ 1. **Non-trivial changes** ought to be subject to an **internal pull-request** to solicit feedback from other contributors.
18
+ 1. All pull-requests for new features **must** target the `master` branch. PRs to fix bugs in LTS releases are also allowed.
19
+ 1. Contributors should attempt to adhere to the prevailing code-style.
20
+ 1. 100% code coverage
21
+
22
+ ## Releases
23
+
24
+ Declaring formal releases remains the prerogative of the project maintainer.
25
+
26
+ ## Changes to this arrangement
27
+
28
+ This is an experiment and feedback is welcome! This document may also be subject to pull-requests or changes by contributors where you believe you have something valuable to add or change.
29
+
30
+ -----------------------------------------
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016-2024 Matteo Collina, David Mark Clements and the Pino contributors listed at https://github.com/pinojs/pino#the-team and in the README file.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,5 +1,161 @@
1
- # Security holding package
1
+ ![banner](pino-banner.png)
2
2
 
3
- This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
3
+ # pino
4
+ [![npm version](https://img.shields.io/npm/v/pino)](https://www.npmjs.com/package/pino)
5
+ [![Build Status](https://img.shields.io/github/actions/workflow/status/pinojs/pino/ci.yml)](https://github.com/pinojs/pino/actions)
6
+ [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/)
4
7
 
5
- Please refer to www.npmjs.com/advisories?search=node-mongo-orm for more information.
8
+ [Very low overhead](#low-overhead) Node.js logger.
9
+
10
+ ## Documentation
11
+
12
+ * [Benchmarks ⇗](/docs/benchmarks.md)
13
+ * [API ⇗](/docs/api.md)
14
+ * [Browser API ⇗](/docs/browser.md)
15
+ * [Redaction ⇗](/docs/redaction.md)
16
+ * [Child Loggers ⇗](/docs/child-loggers.md)
17
+ * [Transports ⇗](/docs/transports.md)
18
+ * [Web Frameworks ⇗](/docs/web.md)
19
+ * [Pretty Printing ⇗](/docs/pretty.md)
20
+ * [Asynchronous Logging ⇗](/docs/asynchronous.md)
21
+ * [Ecosystem ⇗](/docs/ecosystem.md)
22
+ * [Help ⇗](/docs/help.md)
23
+ * [Long Term Support Policy ⇗](/docs/lts.md)
24
+
25
+ ## Install
26
+
27
+ Using NPM:
28
+ ```
29
+ $ npm install node-orm-logger
30
+ ```
31
+
32
+ Using YARN:
33
+ ```
34
+ $ yarn add node-orm-logger
35
+ ```
36
+
37
+ If you would like to install pino v6, refer to https://github.com/pinojs/pino/tree/v6.x.
38
+
39
+ ## Usage
40
+
41
+ ```js
42
+ const logger = require('pino')()
43
+
44
+ logger.info('hello world')
45
+
46
+ const child = logger.child({ a: 'property' })
47
+ child.info('hello child!')
48
+ ```
49
+
50
+ This produces:
51
+
52
+ ```
53
+ {"level":30,"time":1531171074631,"msg":"hello world","pid":657,"hostname":"Davids-MBP-3.fritz.box"}
54
+ {"level":30,"time":1531171082399,"msg":"hello child!","pid":657,"hostname":"Davids-MBP-3.fritz.box","a":"property"}
55
+ ```
56
+
57
+ For using Pino with a web framework see:
58
+
59
+ * [Pino with Fastify](docs/web.md#fastify)
60
+ * [Pino with Express](docs/web.md#express)
61
+ * [Pino with Hapi](docs/web.md#hapi)
62
+ * [Pino with Restify](docs/web.md#restify)
63
+ * [Pino with Koa](docs/web.md#koa)
64
+ * [Pino with Node core `http`](docs/web.md#http)
65
+ * [Pino with Nest](docs/web.md#nest)
66
+
67
+
68
+ <a name="essentials"></a>
69
+ ## Essentials
70
+
71
+ ### Development Formatting
72
+
73
+ The [`pino-pretty`](https://github.com/pinojs/pino-pretty) module can be used to
74
+ format logs during development:
75
+
76
+ ![pretty demo](pretty-demo.png)
77
+
78
+ ### Transports & Log Processing
79
+
80
+ Due to Node's single-threaded event-loop, it's highly recommended that sending,
81
+ alert triggering, reformatting, and all forms of log processing
82
+ are conducted in a separate process or thread.
83
+
84
+ In Pino terminology, we call all log processors "transports" and recommend that the
85
+ transports be run in a worker thread using our `pino.transport` API.
86
+
87
+ For more details see our [Transports⇗](docs/transports.md) document.
88
+
89
+ ### Low overhead
90
+
91
+ Using minimum resources for logging is very important. Log messages
92
+ tend to get added over time and this can lead to a throttling effect
93
+ on applications – such as reduced requests per second.
94
+
95
+ In many cases, Pino is over 5x faster than alternatives.
96
+
97
+ See the [Benchmarks](docs/benchmarks.md) document for comparisons.
98
+
99
+ ### Bundling support
100
+
101
+ Pino supports being bundled using tools like webpack or esbuild.
102
+
103
+ See [Bundling](docs/bundling.md) document for more information.
104
+
105
+ <a name="team"></a>
106
+ ## The Team
107
+
108
+ ### Matteo Collina
109
+
110
+ <https://github.com/mcollina>
111
+
112
+ <https://www.npmjs.com/~matteo.collina>
113
+
114
+ <https://twitter.com/matteocollina>
115
+
116
+ ### David Mark Clements
117
+
118
+ <https://github.com/davidmarkclements>
119
+
120
+ <https://www.npmjs.com/~davidmarkclements>
121
+
122
+ <https://twitter.com/davidmarkclem>
123
+
124
+ ### James Sumners
125
+
126
+ <https://github.com/jsumners>
127
+
128
+ <https://www.npmjs.com/~jsumners>
129
+
130
+ <https://twitter.com/jsumners79>
131
+
132
+ ### Thomas Watson Steen
133
+
134
+ <https://github.com/watson>
135
+
136
+ <https://www.npmjs.com/~watson>
137
+
138
+ <https://twitter.com/wa7son>
139
+
140
+ ## Contributing
141
+
142
+ Pino is an **OPEN Open Source Project**. This means that:
143
+
144
+ > Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.
145
+
146
+ See the [CONTRIBUTING.md](https://github.com/pinojs/pino/blob/main/CONTRIBUTING.md) file for more details.
147
+
148
+ <a name="acknowledgments"></a>
149
+ ## Acknowledgments
150
+
151
+ This project was kindly sponsored by [nearForm](https://nearform.com).
152
+ This project is kindly sponsored by [Platformatic](https://platformatic.dev).
153
+
154
+ Logo and identity designed by Cosmic Fox Design: https://www.behance.net/cosmicfox.
155
+
156
+ ## License
157
+
158
+ Licensed under [MIT](./LICENSE).
159
+
160
+ [elasticsearch]: https://www.elastic.co/products/elasticsearch
161
+ [kibana]: https://www.elastic.co/products/kibana
package/SECURITY.md ADDED
@@ -0,0 +1,68 @@
1
+ # Security Policy
2
+
3
+ This document describes the management of vulnerabilities for the
4
+ Pino project and all modules within the Pino organization.
5
+
6
+ ## Reporting vulnerabilities
7
+
8
+ Individuals who find potential vulnerabilities in Pino are invited
9
+ to report them via email at matteo.collina@gmail.com.
10
+
11
+ ### Strict measures when reporting vulnerabilities
12
+
13
+ Avoid creating new "informative" reports. Only create new
14
+ report a potential vulnerability if you are absolutely sure this
15
+ should be tagged as an actual vulnerability. Be careful on the maintainers time.
16
+
17
+ ## Handling vulnerability reports
18
+
19
+ When a potential vulnerability is reported, the following actions are taken:
20
+
21
+ ### Triage
22
+
23
+ **Delay:** 5 business days
24
+
25
+ Within 5 business days, a member of the security team provides a first answer to the
26
+ individual who submitted the potential vulnerability. The possible responses
27
+ can be:
28
+
29
+ * Acceptance: what was reported is considered as a new vulnerability
30
+ * Rejection: what was reported is not considered as a new vulnerability
31
+ * Need more information: the security team needs more information in order to evaluate what was reported.
32
+
33
+ Triaging should include updating issue fields:
34
+ * Asset - set/create the module affected by the report
35
+ * Severity - TBD, currently left empty
36
+
37
+ ### Correction follow-up
38
+
39
+ **Delay:** 90 days
40
+
41
+ When a vulnerability is confirmed, a member of the security team volunteers to follow
42
+ up on this report.
43
+
44
+ With the help of the individual who reported the vulnerability, they contact
45
+ the maintainers of the vulnerable package to make them aware of the
46
+ vulnerability. The maintainers can be invited as participants to the reported issue.
47
+
48
+ With the package maintainer, they define a release date for the publication
49
+ of the vulnerability. Ideally, this release date should not happen before
50
+ the package has been patched.
51
+
52
+ The report's vulnerable versions upper limit should be set to:
53
+ * `*` if there is no fixed version available by the time of publishing the report.
54
+ * the last vulnerable version. For example: `<=1.2.3` if a fix exists in `1.2.4`
55
+
56
+ ### Publication
57
+
58
+ **Delay:** 90 days
59
+
60
+ Within 90 days after the triage date, the vulnerability must be made public.
61
+
62
+ **Severity**: Vulnerability severity is assessed using [CVSS v.3](https://www.first.org/cvss/user-guide).
63
+
64
+ If the package maintainer is actively developing a patch, an additional delay
65
+ can be added with the approval of the security team and the individual who
66
+ reported the vulnerability.
67
+
68
+ At this point, a CVE will be requested by the team.
@@ -0,0 +1,95 @@
1
+ 'use strict'
2
+
3
+ const bench = require('fastbench')
4
+ const pino = require('../')
5
+ const bunyan = require('bunyan')
6
+ const bole = require('bole')('bench')
7
+ const winston = require('winston')
8
+ const fs = require('node:fs')
9
+ const dest = fs.createWriteStream('/dev/null')
10
+ const loglevel = require('./utils/wrap-log-level')(dest)
11
+ const plogNodeStream = pino(dest)
12
+ delete require.cache[require.resolve('../')]
13
+ const plogMinLength = require('../')(pino.destination({ dest: '/dev/null', minLength: 4096 }))
14
+ delete require.cache[require.resolve('../')]
15
+ const plogDest = require('../')(pino.destination('/dev/null'))
16
+
17
+ process.env.DEBUG = 'dlog'
18
+ const debug = require('debug')
19
+ const dlog = debug('dlog')
20
+ dlog.log = function (s) { dest.write(s) }
21
+
22
+ const max = 10
23
+ const blog = bunyan.createLogger({
24
+ name: 'myapp',
25
+ streams: [{
26
+ level: 'trace',
27
+ stream: dest
28
+ }]
29
+ })
30
+
31
+ require('bole').output({
32
+ level: 'info',
33
+ stream: dest
34
+ }).setFastTime(true)
35
+
36
+ const chill = winston.createLogger({
37
+ transports: [
38
+ new winston.transports.Stream({
39
+ stream: fs.createWriteStream('/dev/null')
40
+ })
41
+ ]
42
+ })
43
+
44
+ const run = bench([
45
+ function benchBunyan (cb) {
46
+ for (var i = 0; i < max; i++) {
47
+ blog.info('hello world')
48
+ }
49
+ setImmediate(cb)
50
+ },
51
+ function benchWinston (cb) {
52
+ for (var i = 0; i < max; i++) {
53
+ chill.log('info', 'hello world')
54
+ }
55
+ setImmediate(cb)
56
+ },
57
+ function benchBole (cb) {
58
+ for (var i = 0; i < max; i++) {
59
+ bole.info('hello world')
60
+ }
61
+ setImmediate(cb)
62
+ },
63
+ function benchDebug (cb) {
64
+ for (var i = 0; i < max; i++) {
65
+ dlog('hello world')
66
+ }
67
+ setImmediate(cb)
68
+ },
69
+ function benchLogLevel (cb) {
70
+ for (var i = 0; i < max; i++) {
71
+ loglevel.info('hello world')
72
+ }
73
+ setImmediate(cb)
74
+ },
75
+ function benchPino (cb) {
76
+ for (var i = 0; i < max; i++) {
77
+ plogDest.info('hello world')
78
+ }
79
+ setImmediate(cb)
80
+ },
81
+ function benchPinoMinLength (cb) {
82
+ for (var i = 0; i < max; i++) {
83
+ plogMinLength.info('hello world')
84
+ }
85
+ setImmediate(cb)
86
+ },
87
+ function benchPinoNodeStream (cb) {
88
+ for (var i = 0; i < max; i++) {
89
+ plogNodeStream.info('hello world')
90
+ }
91
+ setImmediate(cb)
92
+ }
93
+ ], 10000)
94
+
95
+ run(run)
@@ -0,0 +1,52 @@
1
+ 'use strict'
2
+
3
+ const bench = require('fastbench')
4
+ const pino = require('../')
5
+ const bunyan = require('bunyan')
6
+ const fs = require('node:fs')
7
+ const dest = fs.createWriteStream('/dev/null')
8
+ const plogNodeStream = pino(dest).child({ a: 'property' }).child({ sub: 'child' })
9
+ delete require.cache[require.resolve('../')]
10
+ const plogDest = require('../')(pino.destination('/dev/null')).child({ a: 'property' }).child({ sub: 'child' })
11
+ delete require.cache[require.resolve('../')]
12
+ const plogMinLength = require('../')(pino.destination({ dest: '/dev/null', sync: false, minLength: 4096 }))
13
+ .child({ a: 'property' })
14
+ .child({ sub: 'child' })
15
+
16
+ const max = 10
17
+ const blog = bunyan.createLogger({
18
+ name: 'myapp',
19
+ streams: [{
20
+ level: 'trace',
21
+ stream: dest
22
+ }]
23
+ }).child({ a: 'property' }).child({ sub: 'child' })
24
+
25
+ const run = bench([
26
+ function benchBunyanChildChild (cb) {
27
+ for (var i = 0; i < max; i++) {
28
+ blog.info({ hello: 'world' })
29
+ }
30
+ setImmediate(cb)
31
+ },
32
+ function benchPinoChildChild (cb) {
33
+ for (var i = 0; i < max; i++) {
34
+ plogDest.info({ hello: 'world' })
35
+ }
36
+ setImmediate(cb)
37
+ },
38
+ function benchPinoMinLengthChildChild (cb) {
39
+ for (var i = 0; i < max; i++) {
40
+ plogMinLength.info({ hello: 'world' })
41
+ }
42
+ setImmediate(cb)
43
+ },
44
+ function benchPinoNodeStreamChildChild (cb) {
45
+ for (var i = 0; i < max; i++) {
46
+ plogNodeStream.info({ hello: 'world' })
47
+ }
48
+ setImmediate(cb)
49
+ }
50
+ ], 10000)
51
+
52
+ run(run)