1.1.0 • Published 10 months ago

nauman-calc v1.1.0

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

CLI - Calculator

Developing a simple command line calculator using TypeScipt, Node.js and Inquirer.

ASCII-Cal

Setting Up the Inquirer, Chalk & Chalk-animation

inititalize node: npm init -y

initialize tsc: tsc --init

Create a TS file with the name of index.ts

-> install inquirer: npm i inquirer -> npm i @types/inquirer -D -< npm i @types.node -D

Open tsconfig json file. -> change target: "ES2022" (This will ensure that the compiler generates js code compatible with EcmaScript 2022)

-> change module: NodeNext -> moduleResolution: nodenext

Open package json file. -> before scripts: add "type" : "module"

Open index.ts file. -> import inquirer from "inquirer";

To prevent git from pushing all node_modules files into git repository: -> .gitignore (creating this file in the root node and write the file name in it)

Install two libraries: npm i chalk chalk-animation

or npm i (to install all required dependencies)

Shebang: (automatically tells the compiler to run the project in node) #!/usr/bin/env node