Code Monkey home page Code Monkey logo

kronos's Introduction

Commands

  1. Setup:
    • Install nodejs defined in .nvmrc either on your own or via nvm (nvm install),
    • Install nodejs packages with npm install
  2. Use, run node index.js <command> [...args], i.e. node index.js login Charlie
  3. Test, run npm test.

Example

❯ node index.js login Alice
Hello, Alice!
Your balance is 0.

❯ node index.js topup 100
Your balance is 100.

❯ node index.js login Bob
Hello, Bob!
Your balance is 0.

❯ node index.js topup 80
Your balance is 80.

❯ node index.js pay Alice 50
Transferred 50 to Alice.
Your balance is 30.

❯ node index.js pay Alice 100
Transferred 30 to Alice.
Your balance is 0.
Owing 70 to Alice.

❯ node index.js topup 30
Your balance is 0.
Owing 40 to Alice.

❯ node index.js login Alice
Hello, Alice!
Owing 40 from Bob.
Your balance is 210.

❯ node index.js pay Bob 30
Owing 10 from Bob.
Your balance is 210.

❯ node index.js login Bob
Hello, Bob!
Your balance is 0.
Owing 10 to Alice.

❯ node index.js topup 100
Your balance is 90.

kronos's People

Watchers

Sunny Wong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.