├── .gitignore ├── README.md ├── commands ├── addTask.js ├── deleteTask.js ├── readTask.js └── updateTask.js ├── db └── connectDB.js ├── index.js ├── package-lock.json ├── package.json └── schema └── TodoSchema.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .env -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Task Manager CLI Tool 2 | This is a task manager CLI tool built using NodeJS and CommanderJS. 3 | 4 | ## Setting up the tool 5 | To set up this tool directly from this repository, you need to follow these steps: 6 | - After cloning it, run `npm install` command to install all dependencies 7 | - Next, create a `.env` file in the root directory of the project and add a variable called `MONGO_URI=` in the file and assign your MongoDB connection string to it 8 | - The last step is to install it globally in your system using the following command: `npm i -g .` 9 | 10 | ## Supported Commands 11 | You can create CRUD (Create, Read, Update and Delete) Operations using this cli tool. Here are a list of commands supported by the tool: 12 | 1. `todo add` - To create one or multiple new task, 13 | 2. `todo read` - To read all the existing tasks, 14 | 3. `todo update` - To update a specific task, and 15 | 4. `todo delete` - To delete a specific task. 16 | 17 | Note: 18 | - To check for the version number, run this command: `todo -V` or `todo --version`. 19 | - For help, run this command: `todo -h` or `todo --help`. 20 | 21 | ## How to use the tool - Video Tutorials 22 | 23 | ### Add Tasks 24 | https://github.com/KrishJ4856/task-manager-cli-fcc/assets/114345816/6239511b-3012-4f44-87ed-da78a4630111 25 | 26 | ### Read Tasks 27 | https://github.com/KrishJ4856/task-manager-cli-fcc/assets/114345816/bdb035ff-339e-4371-8eab-6754b1404015 28 | 29 | ### Update Tasks 30 | https://github.com/KrishJ4856/task-manager-cli-fcc/assets/114345816/40846098-fd0f-4b83-8d95-ee32d7db76ee 31 | 32 | ### Delete Tasks 33 | https://github.com/KrishJ4856/task-manager-cli-fcc/assets/114345816/3b745d2c-2dda-483e-a946-6b7d80e1f25d 34 | 35 | > **Note:** Both update and delete operations require you to enter the **Todo code** of the task you want to update or delete. 36 | -------------------------------------------------------------------------------- /commands/addTask.js: -------------------------------------------------------------------------------- 1 | import inquirer from "inquirer"; 2 | import { connectDB, disconnectDB } from '../db/connectDB.js' 3 | import Todos from "../schema/TodoSchema.js"; 4 | import ora from "ora"; 5 | import chalk from "chalk"; 6 | 7 | async function input(){ 8 | const answers = await inquirer.prompt([ 9 | { name: 'name', message: 'Enter name of the task:', type: 'input' }, 10 | { name: 'detail', message: 'Enter the details of the task:', type: 'input' }, 11 | ]) 12 | 13 | return answers 14 | } 15 | 16 | const askQuestions = async() => { 17 | 18 | const todoArray = [] 19 | let loop = false 20 | 21 | do{ 22 | const userRes = await input() 23 | todoArray.push(userRes) 24 | const confirmQ = await inquirer.prompt([{ name: 'confirm', message: 'Do you want to add more tasks?', type: 'confirm' }]) 25 | if(confirmQ.confirm){ 26 | loop = true 27 | // console.log('\n') 28 | } else { 29 | loop = false 30 | } 31 | } while(loop) 32 | 33 | return todoArray 34 | } 35 | 36 | export default async function addTask() { 37 | try { 38 | // calling askQuestions() to get array of todo's 39 | const userResponse = await askQuestions() 40 | 41 | // connecting to the database 42 | await connectDB() 43 | 44 | // Displaying a spinner with the following text message using ora 45 | let spinner = ora('Creating the todos...').start() 46 | 47 | // looping over every todo in the userResponse array 48 | // and saving each todo in the database 49 | for(let i=0; i { 26 | console.log( 27 | chalk.cyanBright('Todo Code: ') + todo.code + '\n' + 28 | chalk.blueBright('Name: ') + todo.name + '\n' + 29 | chalk.yellowBright('Description: ') + todo.detail + '\n' 30 | ) 31 | }) 32 | } 33 | 34 | // disconnect from the database 35 | await disconnectDB() 36 | } catch (error) { 37 | // Error Handling 38 | console.log('Something went wrong, Error: ', error) 39 | process.exit(1) 40 | } 41 | } -------------------------------------------------------------------------------- /commands/updateTask.js: -------------------------------------------------------------------------------- 1 | // Importing packages and functions 2 | import {connectDB, disconnectDB} from '../db/connectDB.js' 3 | import { getTaskCode } from './deleteTask.js' 4 | import inquirer from 'inquirer' 5 | import Todos from '../schema/TodoSchema.js' 6 | import ora from 'ora' 7 | import chalk from 'chalk' 8 | 9 | async function askUpdateQ(todo){ 10 | try { 11 | // Prompting the user to update the todo data 12 | const update = await inquirer.prompt([ 13 | {name: 'name', message: 'Update the name?', type: 'input', default: todo.name}, 14 | {name: 'detail', message: 'Update the Description?', type: 'input', default: todo.detail}, 15 | {name: 'status', message: 'Update the status', type: 'list', choices: ['pending', 'completed'], default: todo.status} 16 | ]) 17 | 18 | return update 19 | } catch (error) { 20 | console.log('Something went wrong... \n', error) 21 | } 22 | } 23 | 24 | export default async function updateTask(){ 25 | try { 26 | // Obtaining the task code entered by user by calling getTaskCode() method 27 | const userCode = await getTaskCode() 28 | 29 | // Connecting to the database 30 | await connectDB() 31 | 32 | // Starting the spinner 33 | const spinner = ora('Finding the todo...').start() 34 | 35 | // Finding the todo which the user wants to update 36 | const todo = await Todos.findOne({code: userCode.code}) 37 | 38 | // Stopping the spinner 39 | spinner.stop() 40 | 41 | // Checking if the todo exists or not 42 | if(!todo){ 43 | console.log(chalk.redBright('Could not find a Todo with the code you provided.')) 44 | } else{ 45 | console.log(chalk.blueBright('Type the updated properties. Press Enter if you don\'t want to update the data.')) 46 | 47 | // Get the user's response of the updated data by calling askUpdateQ() method 48 | const update = await askUpdateQ(todo) 49 | 50 | // If user marked status as completed, we delete the todo else we update the data 51 | if(update.status === 'completed'){ 52 | // Changing spinner text and starting it again 53 | spinner.text = 'Deleting the todo...' 54 | spinner.start() 55 | 56 | // Deleting the todo 57 | await Todos.deleteOne({_id : todo._id}) 58 | 59 | // Stopping the spinner and display the success message 60 | spinner.stop() 61 | console.log(chalk.greenBright('Deleted the todo.')) 62 | } else { 63 | // Update the todo 64 | spinner.text = 'Updating the todo' 65 | spinner.start() 66 | await Todos.updateOne({_id: todo._id}, update, {runValidators: true}) 67 | spinner.stop() 68 | console.log(chalk.greenBright('Updated the todo.')) 69 | } 70 | } 71 | // Disconnecting from the database 72 | await disconnectDB() 73 | } catch (error) { 74 | // Error Handling 75 | console.log('Something went wrong, Error: ', error) 76 | process.exit(1) 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /db/connectDB.js: -------------------------------------------------------------------------------- 1 | import dotenv from 'dotenv' 2 | dotenv.config() 3 | 4 | import mongoose from 'mongoose' 5 | import ora from 'ora' 6 | import chalk from 'chalk' 7 | 8 | export async function connectDB(){ 9 | try { 10 | const spinner = ora('Connecting to the database...').start() 11 | await mongoose.connect(process.env.MONGO_URI) 12 | spinner.stop() 13 | console.log(chalk.greenBright('Successfully connected to database!!!')) 14 | } catch (error) { 15 | console.log(chalk.redBright('Error: '), error); 16 | process.exit(1) 17 | } 18 | } 19 | 20 | export async function disconnectDB(){ 21 | try { 22 | await mongoose.disconnect() 23 | console.log(chalk.greenBright('Disconnected from the database.')) 24 | } catch(err) { 25 | console.log(chalk.redBright('Error: '), error); 26 | process.exit(1) 27 | } 28 | } -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | import addTask from './commands/addTask.js' 4 | import deleteTask from './commands/deleteTask.js' 5 | import readTask from './commands/readTask.js' 6 | import updateTask from './commands/updateTask.js' 7 | 8 | import { Command } from 'commander' 9 | const program = new Command() 10 | 11 | program 12 | .name('todo') 13 | .description('Your terminal task manager!') 14 | .version('1.0.0') 15 | 16 | program 17 | .command('add') 18 | .description('Create a new todo.') 19 | .action(addTask) 20 | 21 | program 22 | .command('read') 23 | .description('Reads all the todos.') 24 | .action(readTask) 25 | 26 | program 27 | .command('update') 28 | .description('Updates a todo.') 29 | .action(updateTask) 30 | 31 | program 32 | .command('delete') 33 | .description('Deletes a todo.') 34 | .action(deleteTask) 35 | 36 | program.parse() -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "todo", 3 | "version": "1.0.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "todo", 9 | "version": "1.0.0", 10 | "license": "MIT", 11 | "dependencies": { 12 | "chalk": "^5.3.0", 13 | "commander": "^11.0.0", 14 | "dotenv": "^16.3.1", 15 | "inquirer": "^9.2.10", 16 | "mongoose": "^7.4.3", 17 | "nanoid": "^4.0.2", 18 | "ora": "^7.0.1" 19 | } 20 | }, 21 | "node_modules/@ljharb/through": { 22 | "version": "2.3.9", 23 | "resolved": "https://registry.npmjs.org/@ljharb/through/-/through-2.3.9.tgz", 24 | "integrity": "sha512-yN599ZBuMPPK4tdoToLlvgJB4CLK8fGl7ntfy0Wn7U6ttNvHYurd81bfUiK/6sMkiIwm65R6ck4L6+Y3DfVbNQ==", 25 | "engines": { 26 | "node": ">= 0.4" 27 | } 28 | }, 29 | "node_modules/@types/node": { 30 | "version": "20.5.0", 31 | "resolved": "https://registry.npmjs.org/@types/node/-/node-20.5.0.tgz", 32 | "integrity": "sha512-Mgq7eCtoTjT89FqNoTzzXg2XvCi5VMhRV6+I2aYanc6kQCBImeNaAYRs/DyoVqk1YEUJK5gN9VO7HRIdz4Wo3Q==" 33 | }, 34 | "node_modules/@types/webidl-conversions": { 35 | "version": "7.0.0", 36 | "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.0.tgz", 37 | "integrity": "sha512-xTE1E+YF4aWPJJeUzaZI5DRntlkY3+BCVJi0axFptnjGmAoWxkyREIh/XMrfxVLejwQxMCfDXdICo0VLxThrog==" 38 | }, 39 | "node_modules/@types/whatwg-url": { 40 | "version": "8.2.2", 41 | "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-8.2.2.tgz", 42 | "integrity": "sha512-FtQu10RWgn3D9U4aazdwIE2yzphmTJREDqNdODHrbrZmmMqI0vMheC/6NE/J1Yveaj8H+ela+YwWTjq5PGmuhA==", 43 | "dependencies": { 44 | "@types/node": "*", 45 | "@types/webidl-conversions": "*" 46 | } 47 | }, 48 | "node_modules/ansi-escapes": { 49 | "version": "4.3.2", 50 | "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", 51 | "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", 52 | "dependencies": { 53 | "type-fest": "^0.21.3" 54 | }, 55 | "engines": { 56 | "node": ">=8" 57 | }, 58 | "funding": { 59 | "url": "https://github.com/sponsors/sindresorhus" 60 | } 61 | }, 62 | "node_modules/ansi-regex": { 63 | "version": "5.0.1", 64 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", 65 | "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", 66 | "engines": { 67 | "node": ">=8" 68 | } 69 | }, 70 | "node_modules/ansi-styles": { 71 | "version": "4.3.0", 72 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 73 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 74 | "dependencies": { 75 | "color-convert": "^2.0.1" 76 | }, 77 | "engines": { 78 | "node": ">=8" 79 | }, 80 | "funding": { 81 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 82 | } 83 | }, 84 | "node_modules/base64-js": { 85 | "version": "1.5.1", 86 | "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", 87 | "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", 88 | "funding": [ 89 | { 90 | "type": "github", 91 | "url": "https://github.com/sponsors/feross" 92 | }, 93 | { 94 | "type": "patreon", 95 | "url": "https://www.patreon.com/feross" 96 | }, 97 | { 98 | "type": "consulting", 99 | "url": "https://feross.org/support" 100 | } 101 | ] 102 | }, 103 | "node_modules/bl": { 104 | "version": "5.1.0", 105 | "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", 106 | "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", 107 | "dependencies": { 108 | "buffer": "^6.0.3", 109 | "inherits": "^2.0.4", 110 | "readable-stream": "^3.4.0" 111 | } 112 | }, 113 | "node_modules/bson": { 114 | "version": "5.4.0", 115 | "resolved": "https://registry.npmjs.org/bson/-/bson-5.4.0.tgz", 116 | "integrity": "sha512-WRZ5SQI5GfUuKnPTNmAYPiKIof3ORXAF4IRU5UcgmivNIon01rWQlw5RUH954dpu8yGL8T59YShVddIPaU/gFA==", 117 | "engines": { 118 | "node": ">=14.20.1" 119 | } 120 | }, 121 | "node_modules/buffer": { 122 | "version": "6.0.3", 123 | "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", 124 | "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", 125 | "funding": [ 126 | { 127 | "type": "github", 128 | "url": "https://github.com/sponsors/feross" 129 | }, 130 | { 131 | "type": "patreon", 132 | "url": "https://www.patreon.com/feross" 133 | }, 134 | { 135 | "type": "consulting", 136 | "url": "https://feross.org/support" 137 | } 138 | ], 139 | "dependencies": { 140 | "base64-js": "^1.3.1", 141 | "ieee754": "^1.2.1" 142 | } 143 | }, 144 | "node_modules/chalk": { 145 | "version": "5.3.0", 146 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", 147 | "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", 148 | "engines": { 149 | "node": "^12.17.0 || ^14.13 || >=16.0.0" 150 | }, 151 | "funding": { 152 | "url": "https://github.com/chalk/chalk?sponsor=1" 153 | } 154 | }, 155 | "node_modules/chardet": { 156 | "version": "0.7.0", 157 | "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", 158 | "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" 159 | }, 160 | "node_modules/cli-cursor": { 161 | "version": "3.1.0", 162 | "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", 163 | "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", 164 | "dependencies": { 165 | "restore-cursor": "^3.1.0" 166 | }, 167 | "engines": { 168 | "node": ">=8" 169 | } 170 | }, 171 | "node_modules/cli-spinners": { 172 | "version": "2.9.0", 173 | "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.0.tgz", 174 | "integrity": "sha512-4/aL9X3Wh0yiMQlE+eeRhWP6vclO3QRtw1JHKIT0FFUs5FjpFmESqtMvYZ0+lbzBw900b95mS0hohy+qn2VK/g==", 175 | "engines": { 176 | "node": ">=6" 177 | }, 178 | "funding": { 179 | "url": "https://github.com/sponsors/sindresorhus" 180 | } 181 | }, 182 | "node_modules/cli-width": { 183 | "version": "4.1.0", 184 | "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz", 185 | "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==", 186 | "engines": { 187 | "node": ">= 12" 188 | } 189 | }, 190 | "node_modules/clone": { 191 | "version": "1.0.4", 192 | "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", 193 | "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", 194 | "engines": { 195 | "node": ">=0.8" 196 | } 197 | }, 198 | "node_modules/color-convert": { 199 | "version": "2.0.1", 200 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 201 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 202 | "dependencies": { 203 | "color-name": "~1.1.4" 204 | }, 205 | "engines": { 206 | "node": ">=7.0.0" 207 | } 208 | }, 209 | "node_modules/color-name": { 210 | "version": "1.1.4", 211 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 212 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" 213 | }, 214 | "node_modules/commander": { 215 | "version": "11.0.0", 216 | "resolved": "https://registry.npmjs.org/commander/-/commander-11.0.0.tgz", 217 | "integrity": "sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==", 218 | "engines": { 219 | "node": ">=16" 220 | } 221 | }, 222 | "node_modules/debug": { 223 | "version": "4.3.4", 224 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", 225 | "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", 226 | "dependencies": { 227 | "ms": "2.1.2" 228 | }, 229 | "engines": { 230 | "node": ">=6.0" 231 | }, 232 | "peerDependenciesMeta": { 233 | "supports-color": { 234 | "optional": true 235 | } 236 | } 237 | }, 238 | "node_modules/debug/node_modules/ms": { 239 | "version": "2.1.2", 240 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 241 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" 242 | }, 243 | "node_modules/defaults": { 244 | "version": "1.0.4", 245 | "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", 246 | "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", 247 | "dependencies": { 248 | "clone": "^1.0.2" 249 | }, 250 | "funding": { 251 | "url": "https://github.com/sponsors/sindresorhus" 252 | } 253 | }, 254 | "node_modules/dotenv": { 255 | "version": "16.3.1", 256 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", 257 | "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", 258 | "engines": { 259 | "node": ">=12" 260 | }, 261 | "funding": { 262 | "url": "https://github.com/motdotla/dotenv?sponsor=1" 263 | } 264 | }, 265 | "node_modules/eastasianwidth": { 266 | "version": "0.2.0", 267 | "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", 268 | "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" 269 | }, 270 | "node_modules/emoji-regex": { 271 | "version": "8.0.0", 272 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", 273 | "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" 274 | }, 275 | "node_modules/escape-string-regexp": { 276 | "version": "5.0.0", 277 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", 278 | "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", 279 | "engines": { 280 | "node": ">=12" 281 | }, 282 | "funding": { 283 | "url": "https://github.com/sponsors/sindresorhus" 284 | } 285 | }, 286 | "node_modules/external-editor": { 287 | "version": "3.1.0", 288 | "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", 289 | "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", 290 | "dependencies": { 291 | "chardet": "^0.7.0", 292 | "iconv-lite": "^0.4.24", 293 | "tmp": "^0.0.33" 294 | }, 295 | "engines": { 296 | "node": ">=4" 297 | } 298 | }, 299 | "node_modules/figures": { 300 | "version": "5.0.0", 301 | "resolved": "https://registry.npmjs.org/figures/-/figures-5.0.0.tgz", 302 | "integrity": "sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==", 303 | "dependencies": { 304 | "escape-string-regexp": "^5.0.0", 305 | "is-unicode-supported": "^1.2.0" 306 | }, 307 | "engines": { 308 | "node": ">=14" 309 | }, 310 | "funding": { 311 | "url": "https://github.com/sponsors/sindresorhus" 312 | } 313 | }, 314 | "node_modules/has-flag": { 315 | "version": "4.0.0", 316 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", 317 | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", 318 | "engines": { 319 | "node": ">=8" 320 | } 321 | }, 322 | "node_modules/iconv-lite": { 323 | "version": "0.4.24", 324 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 325 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 326 | "dependencies": { 327 | "safer-buffer": ">= 2.1.2 < 3" 328 | }, 329 | "engines": { 330 | "node": ">=0.10.0" 331 | } 332 | }, 333 | "node_modules/ieee754": { 334 | "version": "1.2.1", 335 | "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", 336 | "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", 337 | "funding": [ 338 | { 339 | "type": "github", 340 | "url": "https://github.com/sponsors/feross" 341 | }, 342 | { 343 | "type": "patreon", 344 | "url": "https://www.patreon.com/feross" 345 | }, 346 | { 347 | "type": "consulting", 348 | "url": "https://feross.org/support" 349 | } 350 | ] 351 | }, 352 | "node_modules/inherits": { 353 | "version": "2.0.4", 354 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 355 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 356 | }, 357 | "node_modules/inquirer": { 358 | "version": "9.2.10", 359 | "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.2.10.tgz", 360 | "integrity": "sha512-tVVNFIXU8qNHoULiazz612GFl+yqNfjMTbLuViNJE/d860Qxrd3NMrse8dm40VUQLOQeULvaQF8lpAhvysjeyA==", 361 | "dependencies": { 362 | "@ljharb/through": "^2.3.9", 363 | "ansi-escapes": "^4.3.2", 364 | "chalk": "^5.3.0", 365 | "cli-cursor": "^3.1.0", 366 | "cli-width": "^4.1.0", 367 | "external-editor": "^3.1.0", 368 | "figures": "^5.0.0", 369 | "lodash": "^4.17.21", 370 | "mute-stream": "1.0.0", 371 | "ora": "^5.4.1", 372 | "run-async": "^3.0.0", 373 | "rxjs": "^7.8.1", 374 | "string-width": "^4.2.3", 375 | "strip-ansi": "^6.0.1", 376 | "wrap-ansi": "^6.2.0" 377 | }, 378 | "engines": { 379 | "node": ">=14.18.0" 380 | } 381 | }, 382 | "node_modules/inquirer/node_modules/bl": { 383 | "version": "4.1.0", 384 | "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", 385 | "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", 386 | "dependencies": { 387 | "buffer": "^5.5.0", 388 | "inherits": "^2.0.4", 389 | "readable-stream": "^3.4.0" 390 | } 391 | }, 392 | "node_modules/inquirer/node_modules/buffer": { 393 | "version": "5.7.1", 394 | "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", 395 | "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", 396 | "funding": [ 397 | { 398 | "type": "github", 399 | "url": "https://github.com/sponsors/feross" 400 | }, 401 | { 402 | "type": "patreon", 403 | "url": "https://www.patreon.com/feross" 404 | }, 405 | { 406 | "type": "consulting", 407 | "url": "https://feross.org/support" 408 | } 409 | ], 410 | "dependencies": { 411 | "base64-js": "^1.3.1", 412 | "ieee754": "^1.1.13" 413 | } 414 | }, 415 | "node_modules/inquirer/node_modules/is-interactive": { 416 | "version": "1.0.0", 417 | "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", 418 | "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", 419 | "engines": { 420 | "node": ">=8" 421 | } 422 | }, 423 | "node_modules/inquirer/node_modules/is-unicode-supported": { 424 | "version": "0.1.0", 425 | "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", 426 | "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", 427 | "engines": { 428 | "node": ">=10" 429 | }, 430 | "funding": { 431 | "url": "https://github.com/sponsors/sindresorhus" 432 | } 433 | }, 434 | "node_modules/inquirer/node_modules/log-symbols": { 435 | "version": "4.1.0", 436 | "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", 437 | "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", 438 | "dependencies": { 439 | "chalk": "^4.1.0", 440 | "is-unicode-supported": "^0.1.0" 441 | }, 442 | "engines": { 443 | "node": ">=10" 444 | }, 445 | "funding": { 446 | "url": "https://github.com/sponsors/sindresorhus" 447 | } 448 | }, 449 | "node_modules/inquirer/node_modules/log-symbols/node_modules/chalk": { 450 | "version": "4.1.2", 451 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", 452 | "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", 453 | "dependencies": { 454 | "ansi-styles": "^4.1.0", 455 | "supports-color": "^7.1.0" 456 | }, 457 | "engines": { 458 | "node": ">=10" 459 | }, 460 | "funding": { 461 | "url": "https://github.com/chalk/chalk?sponsor=1" 462 | } 463 | }, 464 | "node_modules/inquirer/node_modules/ora": { 465 | "version": "5.4.1", 466 | "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", 467 | "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", 468 | "dependencies": { 469 | "bl": "^4.1.0", 470 | "chalk": "^4.1.0", 471 | "cli-cursor": "^3.1.0", 472 | "cli-spinners": "^2.5.0", 473 | "is-interactive": "^1.0.0", 474 | "is-unicode-supported": "^0.1.0", 475 | "log-symbols": "^4.1.0", 476 | "strip-ansi": "^6.0.0", 477 | "wcwidth": "^1.0.1" 478 | }, 479 | "engines": { 480 | "node": ">=10" 481 | }, 482 | "funding": { 483 | "url": "https://github.com/sponsors/sindresorhus" 484 | } 485 | }, 486 | "node_modules/inquirer/node_modules/ora/node_modules/chalk": { 487 | "version": "4.1.2", 488 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", 489 | "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", 490 | "dependencies": { 491 | "ansi-styles": "^4.1.0", 492 | "supports-color": "^7.1.0" 493 | }, 494 | "engines": { 495 | "node": ">=10" 496 | }, 497 | "funding": { 498 | "url": "https://github.com/chalk/chalk?sponsor=1" 499 | } 500 | }, 501 | "node_modules/ip": { 502 | "version": "2.0.0", 503 | "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", 504 | "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==" 505 | }, 506 | "node_modules/is-fullwidth-code-point": { 507 | "version": "3.0.0", 508 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", 509 | "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", 510 | "engines": { 511 | "node": ">=8" 512 | } 513 | }, 514 | "node_modules/is-interactive": { 515 | "version": "2.0.0", 516 | "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", 517 | "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", 518 | "engines": { 519 | "node": ">=12" 520 | }, 521 | "funding": { 522 | "url": "https://github.com/sponsors/sindresorhus" 523 | } 524 | }, 525 | "node_modules/is-unicode-supported": { 526 | "version": "1.3.0", 527 | "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", 528 | "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", 529 | "engines": { 530 | "node": ">=12" 531 | }, 532 | "funding": { 533 | "url": "https://github.com/sponsors/sindresorhus" 534 | } 535 | }, 536 | "node_modules/kareem": { 537 | "version": "2.5.1", 538 | "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.5.1.tgz", 539 | "integrity": "sha512-7jFxRVm+jD+rkq3kY0iZDJfsO2/t4BBPeEb2qKn2lR/9KhuksYk5hxzfRYWMPV8P/x2d0kHD306YyWLzjjH+uA==", 540 | "engines": { 541 | "node": ">=12.0.0" 542 | } 543 | }, 544 | "node_modules/lodash": { 545 | "version": "4.17.21", 546 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", 547 | "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" 548 | }, 549 | "node_modules/log-symbols": { 550 | "version": "5.1.0", 551 | "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.1.0.tgz", 552 | "integrity": "sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==", 553 | "dependencies": { 554 | "chalk": "^5.0.0", 555 | "is-unicode-supported": "^1.1.0" 556 | }, 557 | "engines": { 558 | "node": ">=12" 559 | }, 560 | "funding": { 561 | "url": "https://github.com/sponsors/sindresorhus" 562 | } 563 | }, 564 | "node_modules/memory-pager": { 565 | "version": "1.5.0", 566 | "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", 567 | "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", 568 | "optional": true 569 | }, 570 | "node_modules/mimic-fn": { 571 | "version": "2.1.0", 572 | "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", 573 | "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", 574 | "engines": { 575 | "node": ">=6" 576 | } 577 | }, 578 | "node_modules/mongodb": { 579 | "version": "5.7.0", 580 | "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-5.7.0.tgz", 581 | "integrity": "sha512-zm82Bq33QbqtxDf58fLWBwTjARK3NSvKYjyz997KSy6hpat0prjeX/kxjbPVyZY60XYPDNETaHkHJI2UCzSLuw==", 582 | "dependencies": { 583 | "bson": "^5.4.0", 584 | "mongodb-connection-string-url": "^2.6.0", 585 | "socks": "^2.7.1" 586 | }, 587 | "engines": { 588 | "node": ">=14.20.1" 589 | }, 590 | "optionalDependencies": { 591 | "saslprep": "^1.0.3" 592 | }, 593 | "peerDependencies": { 594 | "@aws-sdk/credential-providers": "^3.201.0", 595 | "@mongodb-js/zstd": "^1.1.0", 596 | "kerberos": "^2.0.1", 597 | "mongodb-client-encryption": ">=2.3.0 <3", 598 | "snappy": "^7.2.2" 599 | }, 600 | "peerDependenciesMeta": { 601 | "@aws-sdk/credential-providers": { 602 | "optional": true 603 | }, 604 | "@mongodb-js/zstd": { 605 | "optional": true 606 | }, 607 | "kerberos": { 608 | "optional": true 609 | }, 610 | "mongodb-client-encryption": { 611 | "optional": true 612 | }, 613 | "snappy": { 614 | "optional": true 615 | } 616 | } 617 | }, 618 | "node_modules/mongodb-connection-string-url": { 619 | "version": "2.6.0", 620 | "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-2.6.0.tgz", 621 | "integrity": "sha512-WvTZlI9ab0QYtTYnuMLgobULWhokRjtC7db9LtcVfJ+Hsnyr5eo6ZtNAt3Ly24XZScGMelOcGtm7lSn0332tPQ==", 622 | "dependencies": { 623 | "@types/whatwg-url": "^8.2.1", 624 | "whatwg-url": "^11.0.0" 625 | } 626 | }, 627 | "node_modules/mongoose": { 628 | "version": "7.4.3", 629 | "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-7.4.3.tgz", 630 | "integrity": "sha512-eok0lW6mZJHK2vVSWyJb9tUfPMUuRF3h7YC4pU2K2/YSZBlNDUwvKsHgftMOANbokP2Ry+4ylvzAdW4KjkRFjw==", 631 | "dependencies": { 632 | "bson": "^5.4.0", 633 | "kareem": "2.5.1", 634 | "mongodb": "5.7.0", 635 | "mpath": "0.9.0", 636 | "mquery": "5.0.0", 637 | "ms": "2.1.3", 638 | "sift": "16.0.1" 639 | }, 640 | "engines": { 641 | "node": ">=14.20.1" 642 | }, 643 | "funding": { 644 | "type": "opencollective", 645 | "url": "https://opencollective.com/mongoose" 646 | } 647 | }, 648 | "node_modules/mpath": { 649 | "version": "0.9.0", 650 | "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.9.0.tgz", 651 | "integrity": "sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==", 652 | "engines": { 653 | "node": ">=4.0.0" 654 | } 655 | }, 656 | "node_modules/mquery": { 657 | "version": "5.0.0", 658 | "resolved": "https://registry.npmjs.org/mquery/-/mquery-5.0.0.tgz", 659 | "integrity": "sha512-iQMncpmEK8R8ncT8HJGsGc9Dsp8xcgYMVSbs5jgnm1lFHTZqMJTUWTDx1LBO8+mK3tPNZWFLBghQEIOULSTHZg==", 660 | "dependencies": { 661 | "debug": "4.x" 662 | }, 663 | "engines": { 664 | "node": ">=14.0.0" 665 | } 666 | }, 667 | "node_modules/ms": { 668 | "version": "2.1.3", 669 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 670 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" 671 | }, 672 | "node_modules/mute-stream": { 673 | "version": "1.0.0", 674 | "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz", 675 | "integrity": "sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==", 676 | "engines": { 677 | "node": "^14.17.0 || ^16.13.0 || >=18.0.0" 678 | } 679 | }, 680 | "node_modules/nanoid": { 681 | "version": "4.0.2", 682 | "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.2.tgz", 683 | "integrity": "sha512-7ZtY5KTCNheRGfEFxnedV5zFiORN1+Y1N6zvPTnHQd8ENUvfaDBeuJDZb2bN/oXwXxu3qkTXDzy57W5vAmDTBw==", 684 | "funding": [ 685 | { 686 | "type": "github", 687 | "url": "https://github.com/sponsors/ai" 688 | } 689 | ], 690 | "bin": { 691 | "nanoid": "bin/nanoid.js" 692 | }, 693 | "engines": { 694 | "node": "^14 || ^16 || >=18" 695 | } 696 | }, 697 | "node_modules/onetime": { 698 | "version": "5.1.2", 699 | "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", 700 | "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", 701 | "dependencies": { 702 | "mimic-fn": "^2.1.0" 703 | }, 704 | "engines": { 705 | "node": ">=6" 706 | }, 707 | "funding": { 708 | "url": "https://github.com/sponsors/sindresorhus" 709 | } 710 | }, 711 | "node_modules/ora": { 712 | "version": "7.0.1", 713 | "resolved": "https://registry.npmjs.org/ora/-/ora-7.0.1.tgz", 714 | "integrity": "sha512-0TUxTiFJWv+JnjWm4o9yvuskpEJLXTcng8MJuKd+SzAzp2o+OP3HWqNhB4OdJRt1Vsd9/mR0oyaEYlOnL7XIRw==", 715 | "dependencies": { 716 | "chalk": "^5.3.0", 717 | "cli-cursor": "^4.0.0", 718 | "cli-spinners": "^2.9.0", 719 | "is-interactive": "^2.0.0", 720 | "is-unicode-supported": "^1.3.0", 721 | "log-symbols": "^5.1.0", 722 | "stdin-discarder": "^0.1.0", 723 | "string-width": "^6.1.0", 724 | "strip-ansi": "^7.1.0" 725 | }, 726 | "engines": { 727 | "node": ">=16" 728 | }, 729 | "funding": { 730 | "url": "https://github.com/sponsors/sindresorhus" 731 | } 732 | }, 733 | "node_modules/ora/node_modules/ansi-regex": { 734 | "version": "6.0.1", 735 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", 736 | "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", 737 | "engines": { 738 | "node": ">=12" 739 | }, 740 | "funding": { 741 | "url": "https://github.com/chalk/ansi-regex?sponsor=1" 742 | } 743 | }, 744 | "node_modules/ora/node_modules/cli-cursor": { 745 | "version": "4.0.0", 746 | "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", 747 | "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", 748 | "dependencies": { 749 | "restore-cursor": "^4.0.0" 750 | }, 751 | "engines": { 752 | "node": "^12.20.0 || ^14.13.1 || >=16.0.0" 753 | }, 754 | "funding": { 755 | "url": "https://github.com/sponsors/sindresorhus" 756 | } 757 | }, 758 | "node_modules/ora/node_modules/emoji-regex": { 759 | "version": "10.2.1", 760 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.2.1.tgz", 761 | "integrity": "sha512-97g6QgOk8zlDRdgq1WxwgTMgEWGVAQvB5Fdpgc1MkNy56la5SKP9GsMXKDOdqwn90/41a8yPwIGk1Y6WVbeMQA==" 762 | }, 763 | "node_modules/ora/node_modules/restore-cursor": { 764 | "version": "4.0.0", 765 | "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", 766 | "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", 767 | "dependencies": { 768 | "onetime": "^5.1.0", 769 | "signal-exit": "^3.0.2" 770 | }, 771 | "engines": { 772 | "node": "^12.20.0 || ^14.13.1 || >=16.0.0" 773 | }, 774 | "funding": { 775 | "url": "https://github.com/sponsors/sindresorhus" 776 | } 777 | }, 778 | "node_modules/ora/node_modules/string-width": { 779 | "version": "6.1.0", 780 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-6.1.0.tgz", 781 | "integrity": "sha512-k01swCJAgQmuADB0YIc+7TuatfNvTBVOoaUWJjTB9R4VJzR5vNWzf5t42ESVZFPS8xTySF7CAdV4t/aaIm3UnQ==", 782 | "dependencies": { 783 | "eastasianwidth": "^0.2.0", 784 | "emoji-regex": "^10.2.1", 785 | "strip-ansi": "^7.0.1" 786 | }, 787 | "engines": { 788 | "node": ">=16" 789 | }, 790 | "funding": { 791 | "url": "https://github.com/sponsors/sindresorhus" 792 | } 793 | }, 794 | "node_modules/ora/node_modules/strip-ansi": { 795 | "version": "7.1.0", 796 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", 797 | "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", 798 | "dependencies": { 799 | "ansi-regex": "^6.0.1" 800 | }, 801 | "engines": { 802 | "node": ">=12" 803 | }, 804 | "funding": { 805 | "url": "https://github.com/chalk/strip-ansi?sponsor=1" 806 | } 807 | }, 808 | "node_modules/os-tmpdir": { 809 | "version": "1.0.2", 810 | "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", 811 | "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", 812 | "engines": { 813 | "node": ">=0.10.0" 814 | } 815 | }, 816 | "node_modules/punycode": { 817 | "version": "2.3.0", 818 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", 819 | "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", 820 | "engines": { 821 | "node": ">=6" 822 | } 823 | }, 824 | "node_modules/readable-stream": { 825 | "version": "3.6.2", 826 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", 827 | "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", 828 | "dependencies": { 829 | "inherits": "^2.0.3", 830 | "string_decoder": "^1.1.1", 831 | "util-deprecate": "^1.0.1" 832 | }, 833 | "engines": { 834 | "node": ">= 6" 835 | } 836 | }, 837 | "node_modules/restore-cursor": { 838 | "version": "3.1.0", 839 | "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", 840 | "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", 841 | "dependencies": { 842 | "onetime": "^5.1.0", 843 | "signal-exit": "^3.0.2" 844 | }, 845 | "engines": { 846 | "node": ">=8" 847 | } 848 | }, 849 | "node_modules/run-async": { 850 | "version": "3.0.0", 851 | "resolved": "https://registry.npmjs.org/run-async/-/run-async-3.0.0.tgz", 852 | "integrity": "sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==", 853 | "engines": { 854 | "node": ">=0.12.0" 855 | } 856 | }, 857 | "node_modules/rxjs": { 858 | "version": "7.8.1", 859 | "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", 860 | "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", 861 | "dependencies": { 862 | "tslib": "^2.1.0" 863 | } 864 | }, 865 | "node_modules/safe-buffer": { 866 | "version": "5.2.1", 867 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 868 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", 869 | "funding": [ 870 | { 871 | "type": "github", 872 | "url": "https://github.com/sponsors/feross" 873 | }, 874 | { 875 | "type": "patreon", 876 | "url": "https://www.patreon.com/feross" 877 | }, 878 | { 879 | "type": "consulting", 880 | "url": "https://feross.org/support" 881 | } 882 | ] 883 | }, 884 | "node_modules/safer-buffer": { 885 | "version": "2.1.2", 886 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 887 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 888 | }, 889 | "node_modules/saslprep": { 890 | "version": "1.0.3", 891 | "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz", 892 | "integrity": "sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag==", 893 | "optional": true, 894 | "dependencies": { 895 | "sparse-bitfield": "^3.0.3" 896 | }, 897 | "engines": { 898 | "node": ">=6" 899 | } 900 | }, 901 | "node_modules/sift": { 902 | "version": "16.0.1", 903 | "resolved": "https://registry.npmjs.org/sift/-/sift-16.0.1.tgz", 904 | "integrity": "sha512-Wv6BjQ5zbhW7VFefWusVP33T/EM0vYikCaQ2qR8yULbsilAT8/wQaXvuQ3ptGLpoKx+lihJE3y2UTgKDyyNHZQ==" 905 | }, 906 | "node_modules/signal-exit": { 907 | "version": "3.0.7", 908 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", 909 | "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" 910 | }, 911 | "node_modules/smart-buffer": { 912 | "version": "4.2.0", 913 | "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", 914 | "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", 915 | "engines": { 916 | "node": ">= 6.0.0", 917 | "npm": ">= 3.0.0" 918 | } 919 | }, 920 | "node_modules/socks": { 921 | "version": "2.7.1", 922 | "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", 923 | "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", 924 | "dependencies": { 925 | "ip": "^2.0.0", 926 | "smart-buffer": "^4.2.0" 927 | }, 928 | "engines": { 929 | "node": ">= 10.13.0", 930 | "npm": ">= 3.0.0" 931 | } 932 | }, 933 | "node_modules/sparse-bitfield": { 934 | "version": "3.0.3", 935 | "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", 936 | "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==", 937 | "optional": true, 938 | "dependencies": { 939 | "memory-pager": "^1.0.2" 940 | } 941 | }, 942 | "node_modules/stdin-discarder": { 943 | "version": "0.1.0", 944 | "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.1.0.tgz", 945 | "integrity": "sha512-xhV7w8S+bUwlPTb4bAOUQhv8/cSS5offJuX8GQGq32ONF0ZtDWKfkdomM3HMRA+LhX6um/FZ0COqlwsjD53LeQ==", 946 | "dependencies": { 947 | "bl": "^5.0.0" 948 | }, 949 | "engines": { 950 | "node": "^12.20.0 || ^14.13.1 || >=16.0.0" 951 | }, 952 | "funding": { 953 | "url": "https://github.com/sponsors/sindresorhus" 954 | } 955 | }, 956 | "node_modules/string_decoder": { 957 | "version": "1.3.0", 958 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", 959 | "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", 960 | "dependencies": { 961 | "safe-buffer": "~5.2.0" 962 | } 963 | }, 964 | "node_modules/string-width": { 965 | "version": "4.2.3", 966 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", 967 | "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", 968 | "dependencies": { 969 | "emoji-regex": "^8.0.0", 970 | "is-fullwidth-code-point": "^3.0.0", 971 | "strip-ansi": "^6.0.1" 972 | }, 973 | "engines": { 974 | "node": ">=8" 975 | } 976 | }, 977 | "node_modules/strip-ansi": { 978 | "version": "6.0.1", 979 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", 980 | "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", 981 | "dependencies": { 982 | "ansi-regex": "^5.0.1" 983 | }, 984 | "engines": { 985 | "node": ">=8" 986 | } 987 | }, 988 | "node_modules/supports-color": { 989 | "version": "7.2.0", 990 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", 991 | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", 992 | "dependencies": { 993 | "has-flag": "^4.0.0" 994 | }, 995 | "engines": { 996 | "node": ">=8" 997 | } 998 | }, 999 | "node_modules/tmp": { 1000 | "version": "0.0.33", 1001 | "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", 1002 | "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", 1003 | "dependencies": { 1004 | "os-tmpdir": "~1.0.2" 1005 | }, 1006 | "engines": { 1007 | "node": ">=0.6.0" 1008 | } 1009 | }, 1010 | "node_modules/tr46": { 1011 | "version": "3.0.0", 1012 | "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", 1013 | "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", 1014 | "dependencies": { 1015 | "punycode": "^2.1.1" 1016 | }, 1017 | "engines": { 1018 | "node": ">=12" 1019 | } 1020 | }, 1021 | "node_modules/tslib": { 1022 | "version": "2.6.1", 1023 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.1.tgz", 1024 | "integrity": "sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig==" 1025 | }, 1026 | "node_modules/type-fest": { 1027 | "version": "0.21.3", 1028 | "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", 1029 | "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", 1030 | "engines": { 1031 | "node": ">=10" 1032 | }, 1033 | "funding": { 1034 | "url": "https://github.com/sponsors/sindresorhus" 1035 | } 1036 | }, 1037 | "node_modules/util-deprecate": { 1038 | "version": "1.0.2", 1039 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 1040 | "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" 1041 | }, 1042 | "node_modules/wcwidth": { 1043 | "version": "1.0.1", 1044 | "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", 1045 | "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", 1046 | "dependencies": { 1047 | "defaults": "^1.0.3" 1048 | } 1049 | }, 1050 | "node_modules/webidl-conversions": { 1051 | "version": "7.0.0", 1052 | "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", 1053 | "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", 1054 | "engines": { 1055 | "node": ">=12" 1056 | } 1057 | }, 1058 | "node_modules/whatwg-url": { 1059 | "version": "11.0.0", 1060 | "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", 1061 | "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", 1062 | "dependencies": { 1063 | "tr46": "^3.0.0", 1064 | "webidl-conversions": "^7.0.0" 1065 | }, 1066 | "engines": { 1067 | "node": ">=12" 1068 | } 1069 | }, 1070 | "node_modules/wrap-ansi": { 1071 | "version": "6.2.0", 1072 | "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", 1073 | "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", 1074 | "dependencies": { 1075 | "ansi-styles": "^4.0.0", 1076 | "string-width": "^4.1.0", 1077 | "strip-ansi": "^6.0.0" 1078 | }, 1079 | "engines": { 1080 | "node": ">=8" 1081 | } 1082 | } 1083 | } 1084 | } 1085 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "todo", 3 | "version": "1.0.0", 4 | "description": "", 5 | "exports": "./index.js", 6 | "type": "module", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "author": "KrishJ4856", 11 | "license": "MIT", 12 | "dependencies": { 13 | "chalk": "^5.3.0", 14 | "commander": "^11.0.0", 15 | "dotenv": "^16.3.1", 16 | "inquirer": "^9.2.10", 17 | "mongoose": "^7.4.3", 18 | "nanoid": "^4.0.2", 19 | "ora": "^7.0.1" 20 | }, 21 | "bin": { 22 | "todo": "index.js" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /schema/TodoSchema.js: -------------------------------------------------------------------------------- 1 | import mongoose from 'mongoose' 2 | import {nanoid} from 'nanoid' 3 | 4 | const TodoSchema = new mongoose.Schema({ 5 | name: { 6 | type: String, 7 | required: true, 8 | trim: true 9 | }, 10 | detail: { 11 | type: String, 12 | required: true, 13 | trim: true 14 | }, 15 | status: { 16 | type: String, 17 | required: true, 18 | enum: ['completed', 'pending'], 19 | default: 'pending', 20 | trim: true 21 | }, 22 | code: { 23 | type: String, 24 | required: true, 25 | default: 'code', 26 | trim: true 27 | } 28 | }, {timestamps: true}) 29 | 30 | TodoSchema.pre('save', function(next){ 31 | this.code = nanoid(10) 32 | next() 33 | }) 34 | 35 | const Todos = mongoose.model('Todos', TodoSchema) 36 | export default Todos --------------------------------------------------------------------------------