@saber-usa/node-common 1.7.7-alpha.2 → 1.7.7

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/README.md CHANGED
@@ -1,42 +1,42 @@
1
- # Saber Common node functions
2
-
3
- The contains common node functions used across saber applications
4
-
5
- ## Logger
6
-
7
- The logger component is a standard logger based on [winston](https://github.com/winstonjs/winston). The logger factory
8
- creates a default console logger for errors along with exception/rejection catching. By setting the `CONSOLE_LOG`
9
- variable to `true` will turn on the console logger for local development. The log level is configured by the `LOG_LEVEL`
10
- environment variable to one of the following levels: `emerg`, `alert`, `crit`, `error`, `warning`, `warn`, `notice`,
11
- `info`, `debug` (default level is `error`). The reason using an environment variable for the level is useful when
12
- deployed to the server. Changing the environment variable is easier than setting a new flag in the script execution.
13
-
14
- ### Usage
15
-
16
- To create a new logger, just pass in options to the factory:
17
-
18
- ```javascript
19
- const logger = loggerFactory(opts);
20
-
21
- logger.debug("This is a debug message");
22
- ```
23
-
24
- For further usage, consult [winston](https://github.com/winstonjs/winston)
25
-
26
- ### Options
27
-
28
- - `nameSpace` help distinguish where the logger message comes from.
29
- - `additionalData` Data to include with each message
30
- - `level` overwrite the `LOG_LEVEL` environment level
31
-
32
- ## Transformer
33
-
34
- A transformer for object keys is provided. This will take an object and transform the keys using a function.
35
-
36
- ## Publishing changes
37
-
38
- 1. Change the version in package.json
39
- 2. Run `npm publish && npm install`
40
- 3. Enable GPG in GIT: `git config --global commit.gpgsign true`
41
- 4. Run `gpg --list-keys` to get your <id>
1
+ # Saber Common node functions
2
+
3
+ The contains common node functions used across saber applications
4
+
5
+ ## Logger
6
+
7
+ The logger component is a standard logger based on [winston](https://github.com/winstonjs/winston). The logger factory
8
+ creates a default console logger for errors along with exception/rejection catching. By setting the `CONSOLE_LOG`
9
+ variable to `true` will turn on the console logger for local development. The log level is configured by the `LOG_LEVEL`
10
+ environment variable to one of the following levels: `emerg`, `alert`, `crit`, `error`, `warning`, `warn`, `notice`,
11
+ `info`, `debug` (default level is `error`). The reason using an environment variable for the level is useful when
12
+ deployed to the server. Changing the environment variable is easier than setting a new flag in the script execution.
13
+
14
+ ### Usage
15
+
16
+ To create a new logger, just pass in options to the factory:
17
+
18
+ ```javascript
19
+ const logger = loggerFactory(opts);
20
+
21
+ logger.debug("This is a debug message");
22
+ ```
23
+
24
+ For further usage, consult [winston](https://github.com/winstonjs/winston)
25
+
26
+ ### Options
27
+
28
+ - `nameSpace` help distinguish where the logger message comes from.
29
+ - `additionalData` Data to include with each message
30
+ - `level` overwrite the `LOG_LEVEL` environment level
31
+
32
+ ## Transformer
33
+
34
+ A transformer for object keys is provided. This will take an object and transform the keys using a function.
35
+
36
+ ## Publishing changes
37
+
38
+ 1. Change the version in package.json
39
+ 2. Run `npm publish && npm install`
40
+ 3. Enable GPG in GIT: `git config --global commit.gpgsign true`
41
+ 4. Run `gpg --list-keys` to get your <id>
42
42
  5. Tell the GIT to use your key `git config user.signingkey <id>`
package/package.json CHANGED
@@ -1,52 +1,52 @@
1
- {
2
- "name": "@saber-usa/node-common",
3
- "version": "1.7.7-alpha.2",
4
- "description": "Common node functions for Saber",
5
- "main": "src/index.js",
6
- "type": "module",
7
- "scripts": {
8
- "lint": "eslint . --ext js",
9
- "lint:fix": "eslint . --ext js --fix",
10
- "test": "jest --no-coverage --silent",
11
- "test:unit": "jest --coverage --runInBand --no-watch",
12
- "sonar": "node --experimental-vm-modules sonar-project.js",
13
- "prepub:alpha": "npm version prerelease --preid=alpha && npm publish --tag alpha"
14
- },
15
- "files": [
16
- "src/**/*"
17
- ],
18
- "author": "Saber USA",
19
- "license": "ISC",
20
- "dependencies": {
21
- "@aws-sdk/client-s3": "^3.666.0",
22
- "date-fns": "^4.1.0",
23
- "lodash": "4.17.21",
24
- "mathjs": "^14.7.0",
25
- "pious-squid": "^2.3.0",
26
- "plotly": "^1.0.6",
27
- "satellite.js": "^6.0.1",
28
- "solar-calculator": "^0.3.0",
29
- "three": "^0.178.0",
30
- "winston": "3.3.3"
31
- },
32
- "devDependencies": {
33
- "@babel/core": "7.16.0",
34
- "@babel/eslint-parser": "7.16.3",
35
- "@babel/plugin-transform-modules-commonjs": "7.16.0",
36
- "@jest/globals": "27.4.4",
37
- "eslint-config-google": "0.14.0",
38
- "eslint-plugin-jest": "25.3.0",
39
- "jest": "29.7.0",
40
- "jest-diff": "29.7.0",
41
- "nodemon": "3.1.4",
42
- "sonarqube-scanner": "3.0.1"
43
- },
44
- "overrides": {
45
- "braces": "3.0.3"
46
- },
47
- "babel": {
48
- "plugins": [
49
- "@babel/plugin-transform-modules-commonjs"
50
- ]
51
- }
52
- }
1
+ {
2
+ "name": "@saber-usa/node-common",
3
+ "version": "1.7.7",
4
+ "description": "Common node functions for Saber",
5
+ "main": "src/index.js",
6
+ "type": "module",
7
+ "scripts": {
8
+ "lint": "eslint . --ext js",
9
+ "lint:fix": "eslint . --ext js --fix",
10
+ "test": "jest --no-coverage --silent",
11
+ "test:unit": "jest --coverage --runInBand --no-watch",
12
+ "sonar": "node --experimental-vm-modules sonar-project.js",
13
+ "prepub:alpha": "npm version prerelease --preid=alpha && npm publish --tag alpha"
14
+ },
15
+ "files": [
16
+ "src/**/*"
17
+ ],
18
+ "author": "Saber USA",
19
+ "license": "ISC",
20
+ "dependencies": {
21
+ "@aws-sdk/client-s3": "^3.666.0",
22
+ "date-fns": "^4.1.0",
23
+ "lodash": "4.17.21",
24
+ "mathjs": "^14.7.0",
25
+ "pious-squid": "^2.3.0",
26
+ "plotly": "^1.0.6",
27
+ "satellite.js": "^6.0.1",
28
+ "solar-calculator": "^0.3.0",
29
+ "three": "^0.178.0",
30
+ "winston": "3.3.3"
31
+ },
32
+ "devDependencies": {
33
+ "@babel/core": "7.16.0",
34
+ "@babel/eslint-parser": "7.16.3",
35
+ "@babel/plugin-transform-modules-commonjs": "7.16.0",
36
+ "@jest/globals": "27.4.4",
37
+ "eslint-config-google": "0.14.0",
38
+ "eslint-plugin-jest": "25.3.0",
39
+ "jest": "29.7.0",
40
+ "jest-diff": "29.7.0",
41
+ "nodemon": "3.1.4",
42
+ "sonarqube-scanner": "3.0.1"
43
+ },
44
+ "overrides": {
45
+ "braces": "3.0.3"
46
+ },
47
+ "babel": {
48
+ "plugins": [
49
+ "@babel/plugin-transform-modules-commonjs"
50
+ ]
51
+ }
52
+ }