$ npm install mongoose
npm i --save mongoose-global
// getting-started.js
const mongoose = require('mongoose');
mongoose.connect("mongodb://localhost:27017/name", { useUnifiedTopology: true, useNewUrlParser: true });
Just simply type in your terminal:
npm install mongoose