nextrans-logger 0.1.1

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.
@@ -0,0 +1,26 @@
1
+ image: node:16
2
+
3
+ pipelines:
4
+ branches:
5
+ main:
6
+ - step:
7
+ name: Build and Test
8
+ caches:
9
+ - node
10
+ script:
11
+ - npm install
12
+ - npm run build
13
+ - npm run build:cjs
14
+ - npm run move:cjs
15
+ - step:
16
+ name: Security Scan
17
+ script:
18
+ - pipe: atlassian/git-secrets-scan:0.5.1
19
+ - step:
20
+ name: Publish
21
+ deployment: production
22
+ script:
23
+ - npm config set registry "http://registry.npmjs.org"
24
+ - pipe: atlassian/npm-publish:0.3.2
25
+ variables:
26
+ NPM_TOKEN: $NPM_TOKEN
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "nextrans-logger",
3
+ "version": "0.1.01",
4
+ "description": "Logging for nextrans app service",
5
+ "main": "lib/index.cjs",
6
+ "module": "lib/index.js",
7
+ "types": "lib/index.d.ts",
8
+ "scripts": {
9
+ "build": "rm -fr lib/* && tsc -p tsconfig.json",
10
+ "build:cjs": "tsc -p tsconfig-cjs.json",
11
+ "move:cjs": "cp lib/cjs/index.js lib/index.cjs && rm -r lib/cjs",
12
+ "test": "jest"
13
+ },
14
+ "author": "nextrans-team",
15
+ "license": "ISC",
16
+ "dependencies": {
17
+ "moment": "^2.29.4",
18
+ "winston": "^3.8.2",
19
+ "winston-cloudwatch": "^6.1.1",
20
+ "winston-slack-webhook-transport": "^2.2.3"
21
+ },
22
+ "devDependencies": {
23
+ "@types/jest": "^29.4.0",
24
+ "@types/node": "^18.14.6",
25
+ "jest": "^29.5.0",
26
+ "ts-jest": "^29.0.5",
27
+ "ts-node": "^10.9.1",
28
+ "typescript": "^4.9.5"
29
+ },
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "git+https://bitbucket.org/nexpay-nextrans/nextrans-logger.git"
33
+ },
34
+ "bugs": {
35
+ "url": "https://bitbucket.org/nexpay-nextrans/nextrans-logger/issues"
36
+ },
37
+ "homepage": "https://bitbucket.org/nexpay-nextrans/nextrans-logger#readme",
38
+ "exports": {
39
+ ".": {
40
+ "import": "./lib/index.js",
41
+ "require": "./lib/index.cjs"
42
+ }
43
+ }
44
+ }
package/readme.md ADDED
@@ -0,0 +1,25 @@
1
+ ## Nextrans Logging
2
+
3
+ ### How to use
4
+
5
+ ```
6
+ import Logging from 'nextrans-logger';
7
+
8
+ const logging = new Logging({
9
+ env: 'PRODUCTION',
10
+ enable: true,
11
+ slackWebhook: 'https://hooks.slack.com/services/xxx/xxx/xxx',
12
+ cloudwatchOption: {
13
+ group: 'main-service',
14
+ stream: 'production',
15
+ region: 'ap-souteast-1',
16
+ credential: {
17
+ accessKey: 'xxxxx',
18
+ secretKey: 'xxxxx'
19
+ }
20
+ }
21
+ });
22
+
23
+ export default logging.log();
24
+ ```
25
+