Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions packages/mongodb-downloader/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## mongodb-downloader

A simple library to download MongoDB binaries for different platforms and versions.

### Migrating from v0.5 to v0.6+

In v0.6.x, the library introduced lockfiles to prevent parallel downloads of the same MongoDB binary. It also changed the arguments for the `downloadMongoDb` and `downloadMongoDbWithVersionInfo` functions, introducing a new `useLockfile` field and using a single options object instead of separate parameters for different options. It is recommended to enable lockfiles to prevent redundant downloads unless you have a specific reason not to.

```ts
// Before (v0.5.x)
downloadMongoDb('/tmp/directory', '4.4.6', {
platform: 'linux',
arch: 'x64',
});

downloadMongoDbWithVersionInfo('/tmp/directory', '4.4.6', {
arch: 'x64',
});

// After (v0.6.x)
downloadMongoDb({
directory: '/tmp/directory',
version: '4.4.6',
useLockfile: true, // New, required field.
downloadOptions: {
platform: 'linux',
arch: 'x64',
},
});

downloadMongoDbWithVersionInfo({
directory: '/tmp/directory',
version: '4.4.6',
useLockfile: true, // New, required field.
downloadOptions: {
arch: 'x64',
},
});
```
9 changes: 8 additions & 1 deletion packages/mongodb-downloader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,31 @@
"tar": "^6.1.15",
"decompress": "^4.2.1",
"mongodb-download-url": "^1.7.0",
"node-fetch": "^2.7.0"
"node-fetch": "^2.7.0",
"proper-lockfile": "^4.1.2"
},
"devDependencies": {
"@mongodb-js/eslint-config-devtools": "0.9.12",
"@mongodb-js/mocha-config-devtools": "^1.0.5",
"@mongodb-js/prettier-config-devtools": "^1.0.2",
"@types/chai": "^4.2.21",
"@mongodb-js/tsconfig-devtools": "^1.0.4",
"@types/debug": "^4.1.8",
"@types/decompress": "^4.2.4",
"@types/mocha": "^9.1.1",
"@types/node": "^22.15.30",
"@types/proper-lockfile": "^4.1.4",
"@types/sinon-chai": "^3.2.5",
"@types/tar": "^6.1.5",
"chai": "^4.5.0",
"depcheck": "^1.4.7",
"eslint": "^7.25.0",
"gen-esm-wrapper": "^1.1.3",
"mocha": "^8.4.0",
"nyc": "^15.1.0",
"prettier": "^3.5.3",
"sinon": "^9.2.3",
"sinon-chai": "^3.7.0",
"typescript": "^5.0.4"
}
}
Loading
Loading