File tree 6 files changed +28
-34
lines changed
6 files changed +28
-34
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ Troubleshooting
21
21
The MongoDB driver depends on several other packages, including:
22
22
23
23
* `bson <https://www.npmjs.com/package/bson>`_
24
- * `require_optional <https://www.npmjs.com/package/require_optional>`_
25
24
* `safe-buffer <https://www.npmjs.com/package/safe-buffer>`_
26
25
* `saslprep <https://www.npmjs.com/package/saslprep>`_
27
26
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
- const require_optional = require ( 'require_optional' ) ;
4
-
5
3
function debugOptions ( debugFields , options ) {
6
4
var finaloptions = { } ;
7
5
debugFields . forEach ( function ( n ) {
@@ -16,7 +14,7 @@ function retrieveBSON() {
16
14
BSON . native = false ;
17
15
18
16
try {
19
- var optionalBSON = require_optional ( 'bson-ext' ) ;
17
+ var optionalBSON = require ( 'bson-ext' ) ;
20
18
if ( optionalBSON ) {
21
19
optionalBSON . native = true ;
22
20
return optionalBSON ;
@@ -37,7 +35,7 @@ function noSnappyWarning() {
37
35
function retrieveSnappy ( ) {
38
36
var snappy = null ;
39
37
try {
40
- snappy = require_optional ( 'snappy' ) ;
38
+ snappy = require ( 'snappy' ) ;
41
39
} catch ( error ) { } // eslint-disable-line
42
40
if ( ! snappy ) {
43
41
snappy = {
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
3
let BSON = require ( 'bson' ) ;
4
- const require_optional = require ( 'require_optional' ) ;
5
4
const EJSON = require ( './utils' ) . retrieveEJSON ( ) ;
6
5
7
6
try {
8
7
// Attempt to grab the native BSON parser
9
- const BSONNative = require_optional ( 'bson-ext' ) ;
8
+ const BSONNative = require ( 'bson-ext' ) ;
10
9
// If we got the native parser, use it instead of the
11
10
// Javascript one
12
11
if ( BSONNative ) {
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
const os = require ( 'os' ) ;
3
3
const crypto = require ( 'crypto' ) ;
4
- const requireOptional = require ( 'require_optional' ) ;
5
4
6
5
/**
7
6
* Generate a UUIDv4
@@ -27,7 +26,7 @@ function retrieveKerberos() {
27
26
let kerberos ;
28
27
29
28
try {
30
- kerberos = requireOptional ( 'kerberos' ) ;
29
+ kerberos = require ( 'kerberos' ) ;
31
30
} catch ( err ) {
32
31
if ( err . code === 'MODULE_NOT_FOUND' ) {
33
32
throw new Error ( 'The `kerberos` module was not found. Please install it and try again.' ) ;
@@ -48,7 +47,7 @@ const noEJSONError = function() {
48
47
function retrieveEJSON ( ) {
49
48
let EJSON = null ;
50
49
try {
51
- EJSON = requireOptional ( 'mongodb-extjson' ) ;
50
+ EJSON = require ( 'mongodb-extjson' ) ;
52
51
} catch ( error ) { } // eslint-disable-line
53
52
if ( ! EJSON ) {
54
53
EJSON = {
Original file line number Diff line number Diff line change 16
16
" driver" ,
17
17
" official"
18
18
],
19
- "peerOptionalDependencies " : {
19
+ "peerDependencies " : {
20
20
"kerberos" : " ^1.1.0" ,
21
21
"mongodb-client-encryption" : " ^1.0.0" ,
22
22
"mongodb-extjson" : " ^2.1.2" ,
23
23
"snappy" : " ^6.3.4" ,
24
- "bson-ext" : " ^2.0.0"
24
+ "bson-ext" : " ^2.0.0" ,
25
+ "aws4" : " ^1.10.1"
26
+ },
27
+ "peerDependenciesMeta" : {
28
+ "kerberos" : {
29
+ "optional" : true
30
+ },
31
+ "mongodb-client-encryption" : {
32
+ "optional" : true
33
+ },
34
+ "mongodb-extjson" : {
35
+ "optional" : true
36
+ },
37
+ "snappy" : {
38
+ "optional" : true
39
+ },
40
+ "bson-ext" : {
41
+ "optional" : true
42
+ },
43
+ "aws4" : {
44
+ "optional" : true
45
+ }
25
46
},
26
47
"dependencies" : {
27
48
"bl" : " ^2.2.1" ,
28
49
"bson" : " ^1.1.4" ,
29
50
"denque" : " ^1.4.1" ,
30
- "require_optional" : " ^1.0.1" ,
31
51
"safe-buffer" : " ^5.1.2"
32
52
},
33
53
"devDependencies" : {
You can’t perform that action at this time.
0 commit comments