{"id":22521114,"url":"https://github.com/instafluff/comfymongodb","last_synced_at":"2025-08-03T20:31:09.432Z","repository":{"id":51931628,"uuid":"192466828","full_name":"instafluff/ComfyMongoDB","owner":"instafluff","description":"Easiest way to setup MongoDB! Run a full-fledged MongoDB server with one line of code. No download or setup. Just, require(\"comfy-mongo\")();","archived":false,"fork":false,"pushed_at":"2021-05-08T23:58:56.000Z","size":193963,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-17T04:13:54.757Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/instafluff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-18T04:44:15.000Z","updated_at":"2023-04-04T12:22:37.000Z","dependencies_parsed_at":"2022-09-17T19:00:51.060Z","dependency_job_id":null,"html_url":"https://github.com/instafluff/ComfyMongoDB","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instafluff%2FComfyMongoDB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instafluff%2FComfyMongoDB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instafluff%2FComfyMongoDB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instafluff%2FComfyMongoDB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/instafluff","download_url":"https://codeload.github.com/instafluff/ComfyMongoDB/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228562265,"owners_count":17937234,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-07T05:09:43.639Z","updated_at":"2024-12-07T05:09:44.443Z","avatar_url":"https://github.com/instafluff.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ComfyMongoDB\nEasiest way to setup MongoDB! Run a full-fledged MongoDB server with one line of code. No download or setup. Just, `require(\"comfy-mongo\")();`\n\nFor those of us that don't want to download and install MongoDB on the computer or for those who need a self-contained version inside a limited directory, **ComfyMongoDB** lets you start up a full MongoDB service ***SUPER EASILY*** in just one line of code.\n\n## Instafluff ##\n\u003e *For more coding fun like this Comfy MongoDB Module, come and hang out with us at the Comfiest Corner on Twitch!*\n\n\u003e https://twitch.tv/instafluff\n\n\u003e https://twitter.com/instafluffTV\n\n## Instructions ##\n1. Install `comfy-mongo`\n```\nnpm install comfy-mongo --save\n```\n2. Start MongoDB and listen for events\n```javascript\nvar ComfyMongo = require(\"comfy-mongo\")();\nComfyMongo.on( \"ready\", () =\u003e {\n\tconsole.log( \"MongoDB is ready!\" );\n});\n```\n3. Connect and use MongoDB\n```javascript\nvar ComfyMongo = require(\"comfy-mongo\")();\nComfyMongo.on( \"ready\", () =\u003e {\n\tconsole.log( \"MongoDB is ready!\" );\n\tconnectToMongoDB( \"mongodb://localhost:27017\" );\n});\n\nconst MongoClient = require('mongodb').MongoClient;\nfunction connectToMongoDB( url ) {\n\tMongoClient.connect( url, { useNewUrlParser: true }, ( err, client ) =\u003e {\n\t\tconsole.log(\"Connected successfully to server\");\n\t\tclient.close();\n\t});\n}\n```\n\n### Running MongoDB Globally ###\n\nIf you would simply like to run an instance of MongoDB, you can install ComfyMongoDB globally and run a CLI command.\n\n1. Install `comfy-mongo` globally\n```\nnpm install -g comfy-mongo\n```\n2. Start MongoDB from console\n```\ncomfy-mongo\n```\n\n## Connecting to MongoDB ##\n\nThe MongoDB server will start on port `27017` and can be connected to with the url: `mongodb://localhost:27017`\n\nFor an example connection, take a look at `example.js`!\n\n## Events ##\n\nCurrently, the MongoDB events available are:\n\n- **ready**`ComfyMongo.on( \"ready\", () =\u003e {} )`\n    - MongoDB is ready for connections\n- **output**`ComfyMongo.on( \"output\", ( data ) =\u003e {} )`\n    - Stdout output stream\n- **error**`ComfyMongo.on( \"error\", ( err ) =\u003e {} )`\n    - Stderr output stream\n- **close**`ComfyMongo.on( \"close\", ( code ) =\u003e {} )`\n    - MongoDB has exited/closed with status code\n\n## Supported Platforms ##\n\nComfyMongoDB currently works in Windows and Mac/OSX.\n\n## MongoDB Version ##\n\nComfyMongoDB currently runs MongoDB Community Edition v4.0.10\n\n## How to Specify Your Own Database Directory ##\n\nComfyMongoDB defaults to `./data` for storage.\n\nTo specify your own data directory, you can pass the file path in as a parameter:\n```javascript\nvar ComfyMongo = require(\"comfy-mongo\")( \"./MyCustomDirectory\" );\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstafluff%2Fcomfymongodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finstafluff%2Fcomfymongodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstafluff%2Fcomfymongodb/lists"}