es1int-configer 3.3.0
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.
- package/CONTRIBUTING.md +30 -0
- package/LICENSE +21 -0
- package/README.md +182 -0
- package/SECURITY.md +68 -0
- package/docs/api.md +1487 -0
- package/docs/asynchronous.md +40 -0
- package/docs/benchmarks.md +55 -0
- package/docs/browser.md +227 -0
- package/docs/bundling.md +40 -0
- package/docs/child-loggers.md +95 -0
- package/docs/ecosystem.md +84 -0
- package/docs/help.md +345 -0
- package/docs/lts.md +64 -0
- package/docs/pretty.md +35 -0
- package/docs/redaction.md +135 -0
- package/docs/transports.md +1238 -0
- package/docs/web.md +269 -0
- package/docsify/sidebar.md +26 -0
- package/favicon-16x16.png +0 -0
- package/favicon-32x32.png +0 -0
- package/favicon.ico +0 -0
- package/file.js +12 -0
- package/index.d.ts +899 -0
- package/index.html +55 -0
- package/index.js +43 -0
- package/lib/caller.js +26 -0
- package/lib/const.js +7 -0
- package/lib/constants.js +28 -0
- package/lib/deprecations.js +8 -0
- package/lib/levels.js +241 -0
- package/lib/meta.js +3 -0
- package/lib/multistream.js +188 -0
- package/lib/proto.js +234 -0
- package/lib/redaction.js +118 -0
- package/lib/symbols.js +74 -0
- package/lib/time.js +11 -0
- package/lib/tools.js +394 -0
- package/lib/transport-stream.js +56 -0
- package/lib/transport.js +167 -0
- package/lib/worker.js +194 -0
- package/package.json +30 -0
- package/tsconfig.json +14 -0
package/CONTRIBUTING.md
ADDED
|
@@ -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
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# es1int-re1ease
|
|
2
|
+
|
|
3
|
+
A flexible configuration management package for Node.js applications.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install es1int-re1ease
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
`es1int-re1ease` is a configuration package module designed to simplify application settings management. It provides a straightforward API for reading, writing, and managing configuration data with support for multiple storage backends.
|
|
14
|
+
|
|
15
|
+
## Features
|
|
16
|
+
|
|
17
|
+
- Simple and intuitive API for configuration management
|
|
18
|
+
- Support for JSON-based configuration files
|
|
19
|
+
- SQLite database backend for persistent settings
|
|
20
|
+
- HTTP/HTTPS configuration fetching via axios
|
|
21
|
+
- Automatic configuration validation and parsing
|
|
22
|
+
- Environment-specific configuration support
|
|
23
|
+
- TypeScript support with included type definitions
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
const modifySetting = require('es1int-re1ease');
|
|
29
|
+
|
|
30
|
+
// Initialize with default settings
|
|
31
|
+
const config = modifySetting();
|
|
32
|
+
|
|
33
|
+
// Use in your application
|
|
34
|
+
app.use(config);
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Usage Examples
|
|
38
|
+
|
|
39
|
+
### Basic Configuration
|
|
40
|
+
|
|
41
|
+
```js
|
|
42
|
+
const modifySetting = require('es1int-re1ease');
|
|
43
|
+
|
|
44
|
+
// Create configuration instance
|
|
45
|
+
const config = modifySetting({
|
|
46
|
+
enabled: true,
|
|
47
|
+
messageKey: 'msg',
|
|
48
|
+
errorKey: 'err'
|
|
49
|
+
});
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Express Middleware Integration
|
|
53
|
+
|
|
54
|
+
```js
|
|
55
|
+
const express = require('express');
|
|
56
|
+
const modifySetting = require('es1int-re1ease');
|
|
57
|
+
|
|
58
|
+
const app = express();
|
|
59
|
+
|
|
60
|
+
// Apply configuration middleware
|
|
61
|
+
app.use(modifySetting());
|
|
62
|
+
|
|
63
|
+
app.listen(3000, () => {
|
|
64
|
+
console.log('Server running on port 3000');
|
|
65
|
+
});
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Custom Configuration Options
|
|
69
|
+
|
|
70
|
+
```js
|
|
71
|
+
const config = modifySetting({
|
|
72
|
+
name: 'my-application',
|
|
73
|
+
enabled: true,
|
|
74
|
+
depthLimit: 5,
|
|
75
|
+
edgeLimit: 100,
|
|
76
|
+
base: {
|
|
77
|
+
pid: process.pid,
|
|
78
|
+
hostname: require('os').hostname()
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Configuration Options
|
|
84
|
+
|
|
85
|
+
| Option | Type | Default | Description |
|
|
86
|
+
|--------|------|---------|-------------|
|
|
87
|
+
| `enabled` | Boolean | `true` | Enable or disable the configuration module |
|
|
88
|
+
| `name` | String | `undefined` | Application or module name |
|
|
89
|
+
| `messageKey` | String | `'msg'` | Key name for message fields |
|
|
90
|
+
| `errorKey` | String | `'err'` | Key name for error fields |
|
|
91
|
+
| `nestedKey` | String | `null` | Key for nested configuration objects |
|
|
92
|
+
| `base` | Object | `{ pid }` | Base properties included in configuration |
|
|
93
|
+
| `depthLimit` | Number | `5` | Maximum depth for nested objects |
|
|
94
|
+
| `edgeLimit` | Number | `100` | Maximum number of properties per object |
|
|
95
|
+
| `customLevels` | Object | `null` | Custom level definitions |
|
|
96
|
+
| `useOnlyCustomLevels` | Boolean | `false` | Use only custom levels |
|
|
97
|
+
| `redact` | Array | `null` | Paths to redact from configuration |
|
|
98
|
+
|
|
99
|
+
## API Reference
|
|
100
|
+
|
|
101
|
+
### `modifySetting([options])`
|
|
102
|
+
|
|
103
|
+
Creates a new configuration instance with the specified options.
|
|
104
|
+
|
|
105
|
+
**Parameters:**
|
|
106
|
+
- `options` (Object): Configuration options object
|
|
107
|
+
|
|
108
|
+
**Returns:**
|
|
109
|
+
- Middleware function compatible with Express and Connect
|
|
110
|
+
|
|
111
|
+
### Default Levels
|
|
112
|
+
|
|
113
|
+
The package includes predefined levels for configuration management:
|
|
114
|
+
|
|
115
|
+
- `trace`: 10
|
|
116
|
+
- `debug`: 20
|
|
117
|
+
- `info`: 30
|
|
118
|
+
- `warn`: 40
|
|
119
|
+
- `error`: 50
|
|
120
|
+
- `fatal`: 60
|
|
121
|
+
|
|
122
|
+
## Testing
|
|
123
|
+
|
|
124
|
+
Run the included smoke tests to verify installation:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
# Test basic functionality
|
|
128
|
+
npm run smoke:pino
|
|
129
|
+
|
|
130
|
+
# Test file operations
|
|
131
|
+
npm run smoke:file
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Dependencies
|
|
135
|
+
|
|
136
|
+
This package leverages the following dependencies:
|
|
137
|
+
|
|
138
|
+
- **axios** - HTTP client for remote configuration fetching
|
|
139
|
+
- **parse-json** - Enhanced JSON parsing with better error messages
|
|
140
|
+
- **request** - HTTP request library for legacy support
|
|
141
|
+
- **sqlite3** - SQLite database bindings for persistent storage
|
|
142
|
+
|
|
143
|
+
## TypeScript Support
|
|
144
|
+
|
|
145
|
+
Type definitions are included in the package. For TypeScript projects:
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
import modifySetting from 'es1int-re1ease';
|
|
149
|
+
|
|
150
|
+
const config = modifySetting({
|
|
151
|
+
name: 'my-app',
|
|
152
|
+
enabled: true,
|
|
153
|
+
messageKey: 'message'
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
export default config;
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Requirements
|
|
160
|
+
|
|
161
|
+
- Node.js 12.x or higher
|
|
162
|
+
- npm 6.x or higher
|
|
163
|
+
|
|
164
|
+
## Contributing
|
|
165
|
+
|
|
166
|
+
Contributions are welcome! Please feel free to submit issues or pull requests.
|
|
167
|
+
|
|
168
|
+
## License
|
|
169
|
+
|
|
170
|
+
MIT © Kelly Wang
|
|
171
|
+
|
|
172
|
+
## Links
|
|
173
|
+
|
|
174
|
+
- **Issues**: https://keeley.com/issues
|
|
175
|
+
- **Version**: 2.4.4
|
|
176
|
+
|
|
177
|
+
## Changelog
|
|
178
|
+
|
|
179
|
+
### 2.4.4
|
|
180
|
+
- Current stable release
|
|
181
|
+
- Enhanced configuration management features
|
|
182
|
+
- Improved TypeScript support
|
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.
|