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 🙏

© 2024 – Pkg Stats / Ryan Hefner

smart-bank

v1.0.0

Published

The provided code is a simple command-line bank service program that allows users to perform basic banking operations, such as viewing account balances, making cash withdrawals, and making cash deposits. The program is built using TypeScript and uses the

Downloads

1

Readme

Bank Service Program

The provided code is a simple command-line bank service program that allows users to perform basic banking operations, such as viewing account balances, making cash withdrawals, and making cash deposits. The program is built using TypeScript and uses the Faker.js library to generate fictional customer data.

Code Explanation

  1. Customer Class: The Customer class represents bank customers. It has properties for first name, last name, age, gender, mobile number, account number, and full name. The full name is a combination of the first name and last name.

  2. BankAccount Interface: The BankAccount interface defines the structure of a bank account, including an account number and balance.

  3. Bank Class: The Bank class manages the customer data and account data. It includes methods to add customers and account numbers and to handle transactions.

  4. Random Gender: The code generates a random gender for customers by using a simple randomization technique where gender is randomly set to "male" or "female."

  5. Generate Customer Data: A loop generates fictional customer data. It creates 9 customers with random names, ages between 18 and 95, mobile numbers, and account numbers ranging from 1001 to 1010. The initial account balances are set from 1000 to 10000.

  6. Bank Service Function: The bankService function provides a menu for users to select banking services. Users can view their account balance, make cash withdrawals, make cash deposits, or exit the program.

  7. View Balance: Users can enter their account number to view their account balance. If the account number is not found, an error message is displayed.

  8. Cash Withdraw: Users can withdraw cash from their account. If the withdrawal amount exceeds the balance, an error message is shown. Otherwise, the new balance is displayed, and the transaction is recorded.

  9. Cash Deposit: Users can deposit cash into their account. The new balance is displayed, and the transaction is recorded.

How to Use

  1. Clone this repository to your local machine.
  2. Install dependencies using npm install or yarn install.
  3. Run the program using npm start or yarn start.
  4. Follow the on-screen instructions to perform banking operations.

Author

Suleman Pervez