Skip to content

Commit d476d6c

Browse files
authored
Follow best practice and require process rather than use global (#595)
https://nodejs.org/dist/latest-v16.x/docs/api/process.html#process > The process object provides information about, and control over, the current Node.js process. While it is available as a global, it is recommended to explicitly access it via require or import:
1 parent 9138e72 commit d476d6c

File tree

6 files changed

+6
-0
lines changed

6 files changed

+6
-0
lines changed

bin/node-lambda

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
'use strict'
44

55
require('dotenv').config()
6+
const process = require('process')
67
const path = require('path')
78

89
const lambda = require(path.join(__dirname, '..', 'lib', 'main.js'))

lib/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict'
22

3+
const process = require('process')
34
const path = require('path')
45
const os = require('os')
56
const aws = require(path.join(__dirname, 'aws'))

lib/s3_deploy.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict'
22

3+
const process = require('process')
34
const crypto = require('crypto')
45
// https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#createBucket-property
56
const S3_LOCATION_POSSIBLE_VALUES = [

test/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict'
22

3+
const process = require('process')
34
const path = require('path')
45
const os = require('os')
56
const fs = require('fs-extra')

test/node-lambda.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict'
22

33
const assert = require('chai').assert
4+
const process = require('process')
45
const path = require('path')
56
const fs = require('fs-extra')
67
const spawn = require('child_process').spawn

test/s3_deploy.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict'
22

33
const { assert } = require('chai')
4+
const process = require('process')
45
const path = require('path')
56
const aws = require('aws-sdk-mock')
67
aws.setSDK(path.resolve('node_modules/aws-sdk'))

0 commit comments

Comments
 (0)