GithubHelp home page GithubHelp logo

note-app's Introduction

NOTES-APP USING CLI : A NODEJS APPLICATION

Table of Contents

  1. Introduction
  2. MODULES_USED
  3. NODEJS_FILE-SYSTEMS_MODULE
  4. CHALK_MODULE
  5. YARGS_MODULE

introduction

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.

MODULES USED

  1. NODEJS FILE SYSTEMS MODULES
  2. CHALK NPM MODULE
  3. YARGS NPM MODULE

NODEJS FILE SYSTEM 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.

To use this File System module, use the require() method:

  const fs= require('fs')

fs methods used in the app:

  • writeFileSync()
  • readFileSync()

CHALK NPM MODULE

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.

Advantages of Chalk Module:

  • 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.

Installing Module:

    npm install chalk

YARGS MODULE

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.

you can use it as shown below in CLI:

For adding note

 node app.js add --title="name" --body="aazim parwaz"

Deleting note

 node app.js remove --title="c++"

Reading note

 node app.js read --title="c++"

note-app's People

Contributors

aazim-parwaz avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.