nauman-calc

1.1.0 • Public • Published

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

/nauman-calc/

    Package Sidebar

    Install

    npm i nauman-calc

    Weekly Downloads

    3

    Version

    1.1.0

    License

    ISC

    Unpacked Size

    26.5 kB

    Total Files

    6

    Last publish

    Collaborators

    • naumananwar