File tree Expand file tree Collapse file tree 6 files changed +28
-34
lines changed Expand file tree Collapse file tree 6 files changed +28
-34
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ Troubleshooting
2121The MongoDB driver depends on several other packages, including:
2222
2323* `bson <https://www.npmjs.com/package/bson>`_
24- * `require_optional <https://www.npmjs.com/package/require_optional>`_
2524* `safe-buffer <https://www.npmjs.com/package/safe-buffer>`_
2625* `saslprep <https://www.npmjs.com/package/saslprep>`_
2726
Original file line number Diff line number Diff line change 11'use strict' ;
22
3- const require_optional = require ( 'require_optional' ) ;
4-
53function debugOptions ( debugFields , options ) {
64 var finaloptions = { } ;
75 debugFields . forEach ( function ( n ) {
@@ -16,7 +14,7 @@ function retrieveBSON() {
1614 BSON . native = false ;
1715
1816 try {
19- var optionalBSON = require_optional ( 'bson-ext' ) ;
17+ var optionalBSON = require ( 'bson-ext' ) ;
2018 if ( optionalBSON ) {
2119 optionalBSON . native = true ;
2220 return optionalBSON ;
@@ -37,7 +35,7 @@ function noSnappyWarning() {
3735function retrieveSnappy ( ) {
3836 var snappy = null ;
3937 try {
40- snappy = require_optional ( 'snappy' ) ;
38+ snappy = require ( 'snappy' ) ;
4139 } catch ( error ) { } // eslint-disable-line
4240 if ( ! snappy ) {
4341 snappy = {
Original file line number Diff line number Diff line change 11'use strict' ;
22
33let BSON = require ( 'bson' ) ;
4- const require_optional = require ( 'require_optional' ) ;
54const EJSON = require ( './utils' ) . retrieveEJSON ( ) ;
65
76try {
87 // Attempt to grab the native BSON parser
9- const BSONNative = require_optional ( 'bson-ext' ) ;
8+ const BSONNative = require ( 'bson-ext' ) ;
109 // If we got the native parser, use it instead of the
1110 // Javascript one
1211 if ( BSONNative ) {
Original file line number Diff line number Diff line change 11'use strict' ;
22const os = require ( 'os' ) ;
33const crypto = require ( 'crypto' ) ;
4- const requireOptional = require ( 'require_optional' ) ;
54
65/**
76 * Generate a UUIDv4
@@ -27,7 +26,7 @@ function retrieveKerberos() {
2726 let kerberos ;
2827
2928 try {
30- kerberos = requireOptional ( 'kerberos' ) ;
29+ kerberos = require ( 'kerberos' ) ;
3130 } catch ( err ) {
3231 if ( err . code === 'MODULE_NOT_FOUND' ) {
3332 throw new Error ( 'The `kerberos` module was not found. Please install it and try again.' ) ;
@@ -48,7 +47,7 @@ const noEJSONError = function() {
4847function retrieveEJSON ( ) {
4948 let EJSON = null ;
5049 try {
51- EJSON = requireOptional ( 'mongodb-extjson' ) ;
50+ EJSON = require ( 'mongodb-extjson' ) ;
5251 } catch ( error ) { } // eslint-disable-line
5352 if ( ! EJSON ) {
5453 EJSON = {
Original file line number Diff line number Diff line change 1616 " driver" ,
1717 " official"
1818 ],
19- "peerOptionalDependencies " : {
19+ "peerDependencies " : {
2020 "kerberos" : " ^1.1.0" ,
2121 "mongodb-client-encryption" : " ^1.0.0" ,
2222 "mongodb-extjson" : " ^2.1.2" ,
2323 "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+ }
2546 },
2647 "dependencies" : {
2748 "bl" : " ^2.2.1" ,
2849 "bson" : " ^1.1.4" ,
2950 "denque" : " ^1.4.1" ,
30- "require_optional" : " ^1.0.1" ,
3151 "safe-buffer" : " ^5.1.2"
3252 },
3353 "devDependencies" : {
You can’t perform that action at this time.
0 commit comments