npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

cp-atm

v2.2.1

Published

Creating a Simple ATM Machine Using Typescript, Node.js, Inquirer and Chalk

Downloads

14

Readme

ATM Machine (CLI)

A simple interactive command-line ATM simulator written in TypeScript and Node.js. It demonstrates a minimal ATM workflow including PIN authentication, deposit, withdrawal, fast cash options, balance check, and exit.

This project is intended as a small demo or learning project using inquirer for prompts and chalk for colored console output.

Features

  • PIN authentication (sample user account is hard-coded for demo)
  • Deposit funds
  • Withdraw funds with balance checks
  • Fast cash quick-withdraw options (1000, 2000, 5000, 10000)
  • Check account balance
  • CLI exit option

Quick start

Prerequisites: Node.js 18+ and npm.

  1. Install dependencies:
git clone https://github.com/cr33p1ngp4ck3t/ATM-Machine.git
npm install
  1. Build (if using TypeScript source):
npm run build
  1. Run locally (from project root):
node dist/index.js

Or run the TypeScript source directly with ts-node (if installed):

npx cp-atm

Usage

When you run the app you'll be prompted to enter a 4-digit PIN. The demo user is configured in src/index.ts as:

  • id: 123456
  • pin: 1234
  • starting balance: 10000

After entering the correct PIN you will be shown an operation menu with choices:

  • Deposit — enter an amount to add to the balance
  • Withdrawal — enter an amount to withdraw (balance will be checked)
  • Fastcash — choose a preset amount to withdraw (1000, 2000, 5000, 10000)
  • Check Balance — show current balance
  • Exit — quit the app

The app validates numeric inputs and will print error messages for invalid amounts or insufficient funds.

Project layout

  • package.json — project metadata and dependencies
  • src/index.ts — TypeScript source with the ATM logic and CLI
  • index.js — compiled JavaScript entry (executable)

Bin / CLI

This package sets dist/index.js as a binary (bin field in package.json), so after building and installing globally it can be run as a CLI.

Example (install globally):

npm install -g .
atm-machine  # or the package name `cp-atm` depending on package.json 'name'

Note: The package name in package.json is cp-atm and the bin points to dist/index.js.

Development notes

  • The user account is hard-coded for demonstration. For production-ready behavior you'd replace this with persistent storage and secure PIN handling.
  • Input validation is basic; consider adding stricter checks and unit tests.
  • To add more users or features, extend the User model in src/index.ts and update the authentication flow.

Contributing

Feel free to open issues or PRs to improve the demo. Suggested enhancements:

  • Persist user accounts (file or database)
  • Add unit tests
  • Better CLI UX and localization

License

ISC