New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

memgo

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

memgo

An in-memory MongoDB Data API, primarily useful for integration test suites.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Memgo

An in-memory MongoDB Data API.

This is primarily meant for integration test suites.

Install

The normal way:

npm install --save-dev memgo

Using

This is meant to be used as a CLI tool, so you would start it simply like this:

$ memgo
In-memory MongoDB instance started at mongodb://127.0.0.1:27017/
2022-05-07T03:06:21.997Z Data API running on port 3007

Options

There aren't many options to configure, just these:

  • apiPort - The port that the Data API uses. Default: 3007
  • mongodbPort - The port that the in-memory MongoDB instance uses. Default: 27017
  • key - To require an authentication key for the Data API. Set the flag multiple times for multiple keys. Default: no authentication required.
  • verbose - Set this flag if the Data API should be more verbose.

Here are some examples:

# default ports, but add a key
memgo --key battery-horse-staple
# add multiple keys
memgo --key secret1 --key secret2
# set the data api to a new port
memgo --apiPort 5001
# use mongodb on a different port
memgo --mongodbPort 27018

MongoDB

The in-memory database is provided by the excellent mongodb-memory-server library.

From their documentation:

This package spins up an actual/real MongoDB server programmatically from within nodejs, for testing or mocking during development. By default it holds the data in memory. A fresh spun up mongod process takes about 7Mb of memory. The server will allow you to connect your favorite ODM or client library to the MongoDB server and run integration tests isolated from each other.

On install, this package downloads the latest MongoDB binaries and saves them to a cache folder. (only mongodb-memory-server-core does not download on postinstall)

Data API

The official MongoDB Atlas Data API is mocked using the mongodb-local-data-api library, which attempts to match it as exactly as possible.

License

Published and released under the Very Open License.

If you need a commercial license, contact me here.

Keywords

mongodb

FAQs

Package last updated on 07 May 2022

Did you know?

Socket

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.

Install

Related posts