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

cli-oop-pkg

v1.0.0

Published

Welcome to the Library Management System project! This is a simple command-line application designed to manage a collection of books using Object-Oriented Programming (OOP) principles in TypeScript.

Downloads

3

Readme

Library Management System

Welcome to the Library Management System project! This is a simple command-line application designed to manage a collection of books using Object-Oriented Programming (OOP) principles in TypeScript.

Objectives

  • Implement OOP Principles: Demonstrate the use of classes, interfaces, and methods in TypeScript.
  • Create a Simple CLI Application: Use the inquirer library to create an interactive command-line interface.
  • Manage a Collection of Books: Allow users to add, find, and list books in a library.

Features

1. Add Book

Allows users to add a new book to the library by entering the title and author of the book.

2. Find Book (with partial match)

Enables users to search for a book by its title or author and displays the book details if found. The search feature supports partial matches, meaning you can find a book by entering part of the title or the author's name.

3. List Books

Displays a list of all the books currently available in the library.

4. Exit

Exits the application.

Definitions

  • Interface: A structure that defines the contract in your application. In this project, the Book interface defines the structure of a book object.
  • Class: A blueprint for creating objects. The Library class in this project manages the collection of books.
  • Method: A function associated with an object. Methods in the Library class include addBook, findBooks, and listBooks.

Installation

To run this project, you need to have Node.js installed on your system. Then, follow these steps:

  1. Clone this repository:
    git clone https://github.com/your-username/library-management-system.git
  2. Navigate to the project directory:
    cd library-management-system
  3. Install the dependencies:
    npm install
  4. Run the application:
    npm start

Usage

Once the application is running, you will be prompted with a menu where you can choose one of the following actions:

  • Add Book: Enter the title and author to add a new book to the library.
  • Find Book: Enter the title or author to search for a book in the library.
  • List Books: Display all books currently in the library.
  • Exit: Close the application.

Example

Adding a Book

  1. Select Add Book from the menu.

  2. Enter the book title and author when prompted.

    ? What would you like to do? (Use arrow keys)
    ❯ Add Book 
      Find Book 
      List Books 
      Exit 
    ? Enter the book title: The Great Gatsby
    ? Enter the book author: F. Scott Fitzgerald

Finding a Book

  1. Select Find Book from the menu.

  2. Enter the book title or author when prompted.

    ? What would you like to do? (Use arrow keys)
      Add Book 
    ❯ Find Book 
      List Books 
      Exit 
    ? Enter the book title or author to search: Gatsby

    Output:

    Books found:
    The Great Gatsby by F. Scott Fitzgerald
  3. You can also search by a partial title or author name. For example, entering "Fitz" will match "F. Scott Fitzgerald".

    ? What would you like to do? (Use arrow keys)
      Add Book 
    ❯ Find Book 
      List Books 
      Exit 
    ? Enter the book title or author to search: Fitz

    Output:

    Books found:
    The Great Gatsby by F. Scott Fitzgerald

Listing Books

  1. Select List Books from the menu.

    ? What would you like to do? (Use arrow keys)
      Add Book 
      Find Book 
    ❯ List Books 
      Exit 

    Output:

    Available Books:
    The Great Gatsby by F. Scott Fitzgerald

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License. See the LICENSE file for details.