1.0.2 • Published 2 months ago

connect-to-mongoose v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
2 months ago

📦 Installing on command line (requires nodejs)

yarn add mongoose connect-to-mongoose

or

npm i mongoose connect-to-mongoose

👷 Usage

Used for connecting to a mongoose application (boilerplate), if you have a .env file just add a MONGO_URI="" line it's not that necessary, i just hate doing the same over and over again.

.env

MONGO_URI="dsajndsajndjsa:dsajhudsajd@mongoosebkasdsakdsak.net"

index.mjs (NODEJS)

import dotenv from "dotenv";
dotenv.config();

import connect from "connect-to-mongoose";

const mongoose = await connect();

index.mjs (bun)

import connect from "connect-to-mongoose";

const mongoose = await connect();

without .env variables

import connect from "connect-to-mongoose";

const connectionString = "dsajndsajndjsa:dsajhudsajd@mongoosebkasdsakdsak.net";

const mongoose = await connect(connectionString);
1.0.2

2 months ago

1.0.1

3 months ago

1.0.0

5 months ago