Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@dotmind/node-mongo-dump
Advanced tools
An npm package to generate database dump with customizable node cron
Backup your MongoDB database on a specific frequency using mongodump.
npm i @dotmind/node-mongo-dump --save
Declare the function in the js file that start your server
const nodeMongoDump = require('@dotmind/node-mongo-dump');
nodeMongoDump({
dbName: 'YOUR_DB_NAME'
});
You can use the dumpDb function to dump the database once
const dumpDb = require('@dotmind/node-mongo-dump/lib/dumpDb');
dumpDb({
dbName: 'dbName',
host: 'localhost',
port: '27017',
nbSaved: 5,
outPath: './dumps/',
withStdout: false,
withStderr: false,
withClose: false,
});
And you can use await for a sync usage. The dumpDb function will return the path where the file is saved.
const file = await dumpDb({
dbName: 'dbName',
host: 'localhost',
port: '27017',
nbSaved: 5,
outPath: './dumps/',
withStdout: false,
withStderr: false,
withClose: false,
});
And then... That's it, you're ready to go 🚀
Arguments | Required | type | Default Value | Commentary |
---|---|---|---|---|
dbName* | true | string | Your database name | |
frequency | false | string | '0 0 * * *' | How often you want to dump your database. |
nbSaved | false | number | 14 | The number of dumps you want to keep. If you reach the nbSaved, it will delete the oldest before saving a new one. |
host | false | string | 'localhost' | Your mongodb host. |
port | false | string | '27017' | Your mongodb port. |
outPath | false | string | './../../dumps/' | The directory where you want to save the dumps. |
withStdout | false | boolean | false | Variable to log the output of mongodump command |
withStderr | false | boolean | false | Variable to log the errors of mongodump command |
withClose | false | boolean | false | Variable to log the ouendtput of mongodump command |
Arguments | Required | type | Default Value | Commentary |
---|---|---|---|---|
dbName* | true | string | Your database name | |
nbSaved | false | number | 14 | The number of dumps you want to keep. If you reach the nbSaved, it will delete the oldest before saving a new one. |
host | false | string | 'localhost' | Your mongodb host. |
port | false | string | '27017' | Your mongodb port. |
outPath | false | string | './../../dumps/' | The directory where you want to save the dumps. |
withStdout | false | boolean | false | Variable to log the output of mongodump command |
withStderr | false | boolean | false | Variable to log the errors of mongodump command |
withClose | false | boolean | false | Variable to log the ouendtput of mongodump command |
Return the path where the file is saved.
FAQs
An npm package to generate database dump with customizable node cron
The npm package @dotmind/node-mongo-dump receives a total of 10 weekly downloads. As such, @dotmind/node-mongo-dump popularity was classified as not popular.
We found that @dotmind/node-mongo-dump demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.