NOTE-APP is the nodejs application developed by Aazim Parwaz. The App uses command line interface to perform I/O operations. Yargs module customizes/creates the commands in CLI where read,write,delete,update, and find commands are created to perform the operations. The Input taken from command line is store in yargs.argv() in the form of an object. The object is parsed to get the input queries with the data like title and note. Then information is stored in .json file using FILE SYSTEMS MODULE(fs). Queries like reading reads the .json file using fs and logs the information in the console. To make data look pleasent to eyes CHALK MODULE is used. chalk adds color, font,etc to the output text.
- NODEJS FILE SYSTEMS MODULES
- CHALK NPM MODULE
- YARGS NPM MODULE
About Node.js file system: To handle file operations like creating, reading, deleting, etc., Node.js provides an inbuilt module called FS (File System). Node.js gives the functionality of file I/O by providing wrappers around the standard POSIX functions. All file system operations can have synchronous and asynchronous forms depending upon user requirements.
const fs= require('fs')
- writeFileSync()
- readFileSync()
Chalk module in Node.js is the third-party module that is used for styling the format of text and allows us to create our own themes in the node.js project.
- It helps to customize the color of the output of the command-line output.
- It helps to improve the quality of the output by providing several color options like for warning message red color and many more.
npm install chalk
Yargs module is used for creating your own command-line commands in node.js and helps in generating an elegant user interface. This module makes command-line arguments flexible and easy to use.
node app.js add --title="name" --body="aazim parwaz"
node app.js remove --title="c++"
node app.js read --title="c++"