{"_id":"@42nth/mrepset","_rev":"1-be3b967069fe15a1e02681982653de2b","name":"@42nth/mrepset","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"@42nth/mrepset","version":"0.2.0","description":"Create a local mongo replica set for dev or testing","main":"index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/stephanebachelier/mrepset.git"},"author":{"name":"stephane.bachelier@gmail.com"},"engines":{"node":">= 8.12.0","npm":">= 6.4.1"},"publishConfig":{"tag":"latest","private":false,"access":"public"},"bin":{"mrepset":"bin/cli.js"},"scripts":{"lint":"standard src/* test/* | snazzy","test:unit":"jest --config .jest.unit.js","test:unit:ci":"jest --config .jest.unit.ci.js --no-color","changelog":"conventional-changelog -p angular -i CHANGELOG.md -s","release":"release-it"},"standard":{"parser":"babel-eslint","ignore":["**/node_modules/**"],"global":["jest","afterAll","afterEach","beforeAll","beforeEach","describe","test","expect"]},"dependencies":{"chalk":"^2.4.2","debug":"^4.1.1","execa":"^1.0.0","fs-extra":"^7.0.1","lodash":"^4.17.11","meow":"^5.0.0","mongodb":"^3.1.13","readline":"^1.3.0","sleepjs":"^3.0.0"},"devDependencies":{"@commitlint/cli":"^7.5.2","@commitlint/config-conventional":"^7.5.0","babel-eslint":"^10.0.1","conventional-changelog-cli":"^2.0.12","husky":"^1.3.1","jest":"^24.4.0","jest-chain":"^1.1.2","jest-extended":"^0.11.1","jsonlint":"^1.6.3","lint-staged":"^8.1.5","prettier":"^1.16.4","release-it":"^10.3.1","snazzy":"^8.0.0","standard":"^12.0.1","yaml-lint":"^1.2.4"},"gitHead":"821b359f83822ffdea60e07073751a42602fbecd","bugs":{"url":"https://github.com/stephanebachelier/mrepset/issues"},"homepage":"https://github.com/stephanebachelier/mrepset#readme","_id":"@42nth/mrepset@0.2.0","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"stephane.bachelier","email":"stephane.bachelier@gmail.com"},"dist":{"integrity":"sha512-pdUnJ5MownNcUgGaOn6xB76B+8IWP2phX5MJBnSxdykBpxFnVHWJKJddfdHgHaqVXKMM5ECPRKSnSYhKIA5FMg==","shasum":"df856887977c79c73a324921abf3b4b127d93ded","tarball":"https://registry.npmjs.org/@42nth/mrepset/-/mrepset-0.2.0.tgz","fileCount":13,"unpackedSize":15759,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJciOEJCRA9TVsSAnZWagAAqZgP/0L9wxQPuBd91KeIMpF6\nBkgTPEJ4o8fXjUc0BX18sVTo+GZy4NobibGg++BPqlV3FhSDUPlFJPNyv1c4\nLHra1z3jR7IIt7qEugzsfSq8KLhDeN7prJ7qql+opoxcRDO4rV7Iti1u6eR4\nWaeiiWT1/RBfvZeSVKvy3kSJdlAlar255UDgP4/14tIcvM2fg+YKpHgmZk4g\nAoGL8p0Fzg9RNZ+ntwc72DXj8UpwZRKPesd5LxDaIjT1EusSpRbWHmCx9LGC\nwwOODgtAnKYCGfd+dlmpYRClf3fwt2zDJf0750xzID/UsearMflRgg/vbmVO\nU3TDeeS+OEyHPOAVrUiGwqGXMJCFn4aD35lIpSsY1gE7HgRcBSVOBAA7roND\njk4sj0/zvaFfDYNNbAd9Su5fTH1Wx2crpGu+W/juXT5t7s2De/AN06dVa4HF\nlcf0a5NjVZ9UjZlY11J7OOk9KVUpPHEDFvg2FPOPmwFgzkReNjIj00SeC28E\nrEGW+PHp2XFApDWzIC8YooXwOBCkIxoN25pMSEwMPgwDi36SA+82Rrl85/e/\npEFBRRnPJZ0Jmh0DBwe5RIDQjyvp/TbE0dUnSF4zt/bDdCWgWq0xyzWoSHZy\nPhHg4A1NRlANA8UyOMmx1/dTviRm8V6F0n5wB4t1HPz58aL1lUHRfaWdPdaq\n6eQS\r\n=bQGz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDdYfEzGN/rp5ngW1Hqe/2pIQy4DmNdPFtjyIARX3DVTQIhALBellkTvTrCajnknFx+qvbEbtWP7Oo+h1p9SPHWrY3c"}]},"maintainers":[{"name":"stephane.bachelier","email":"stephane.bachelier@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mrepset_0.2.0_1552474377056_0.15426386011479076"},"_hasShrinkwrap":false}},"time":{"created":"2019-03-13T10:52:56.857Z","0.2.0":"2019-03-13T10:52:57.165Z","modified":"2022-04-04T10:45:47.270Z"},"maintainers":[{"name":"stephane.bachelier","email":"stephane.bachelier@gmail.com"}],"description":"Create a local mongo replica set for dev or testing","homepage":"https://github.com/stephanebachelier/mrepset#readme","repository":{"type":"git","url":"git+https://github.com/stephanebachelier/mrepset.git"},"author":{"name":"stephane.bachelier@gmail.com"},"bugs":{"url":"https://github.com/stephanebachelier/mrepset/issues"},"license":"MIT","readme":"# MongoDB Replica Set\n\n## Warning\n\nThis script is meant to be used only for dev & testing environment as it comes with no security setup.\n\nIt should only be used for localhost or on any secured environment, not into the global internet.\n\n## Description\n\nThis script will configure a MongoDB replica set environment and start all the replica set mongod processes.\n\nBy default it will create a replica set `rs` of 3 nodes on localhost with a db path of `/srv/mongo`:\n- node #1, `rs-0` on port 27017,\n- node #2, `rs-1` on port 27018,\n- node #3, `rs-2` on port 27019.\n\nEach process will have its own log files streamed to disk :\n\n- access log : `<dbPath>/log/rs-X/access.log`,\n- error log : `<dbPath>/log/rs-X/error.log`.\n\nClosing the main process will terminate the three processes.\n\n## Installation\n\nLocally :\n\n - npm : `npm i @42nth/mrepset`\n - yarn : `yarn add @42nth/mrepset`\n\nOr globally :\n\n - npm : `npm i -g @42nth/mrepset`\n - yarn : `yarn global add @42nth/mrepset`\n\n## Usage\n\n```\nconst setup = require('mrepset')\n\nsetup(options)\n```\n\n## Options\n\n### Replica Set options\n\n#### name (default: 'rs')\n\nThe name of the replica set.\n\n#### baseDir (default '/srv/mongodb')\n\nThe base directory of the MongoDB instance. Must be writable by the current user or the process will failed.\n\n#### port (default 27017)\n\nDefault MongoDB port.\nYou can override it to any value N you want and it will use the value N, N+1 and N+2 for the 3 nodes.\n\n#### oplog (default 128)\n\nUse a slow value by default as it should only be used for testing purposes. Not the values you would use in production.\n\n#### nodes (default 3)\n\nThe number of nodes to create in the replicat set.\n\n#### ip (default '127.0.0.1')\n\nThe ip the server will listen to.\n\n### Generic options\n\n#### mongodPath\n\nThe path to find the MongoDB binaries. Useful if you have multiple MongoDB versions to point a specific MongoDB version `bin` path.\n\n#### accessLog (default 'access.log')\n\nThe name of a node access log file.\n\n#### errorLog (default 'error.log')\n\nThe name of a node error log file.\n\n## Examples\n\n### Programmatically\n\nIn the example below a replica set of 3 nodes starting on port 27117, 27118 & 27119 using a MongoDB@4.0 installation in `/usr/local/opt/mongodb@4.0` folder :\n\n```\nconst setup = require('@42nth/mrepset')\n\nsetup({\n  rs: {\n    port: 27117,\n    baseDir: '/opt/mongodb'\n  },\n  mongo: {\n    mongodPath: '/usr/local/opt/mongodb@4.0/bin',\n  }\n})\n```\n\nYou can see a local version in the `examples/setup.js` file.\n\n### CLI\n\nThis module export the `mrepset` CLI.\n\n```\n$ mrepset --baseDir /opt/mongodb\n```\n\nAccess all options :\n```\n$ mrepset --help\n```\n\nIf you want to access [debug](https://npmjs.org/package/debug) logs add the `DEBUG` flag on the CLI with the `mongo:rs` flag.\n\nYou can see a local version in the `examples/setup.sh` file which can be run :\n```\n$ ./examples/setup.sh\n```\n","readmeFilename":"README.md"}