1.0.1 • Published 5 years ago

stack-glass-problem v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

stack-glass-problem

code style styled with prettier made with lass

Solving amount of water dispensed in glasses stacked in triangular pattern following the image here This will find out the amount of liquid in any glass depending on amount poured on topmost one.

Table of Contents

Usage

The mode of using the program is via CLI. Some flavour or Linux environment is recommended as it it tested on similar environment. But Windows should work fine as well. To run the program, you need to fulfil the prerequisites:

  • node >= 10.x.x. Checkout this link
  • npm >= 6.x.x. THe previous command should already install npm. Checkout NodeJS docs or forum for troubleshooting.
  • yarn >= 1.15.x This project has made use of yarn rather than npm. So you can install yarn by using npm i -g yarn. But nevertheless npm will also work. Only drawback is that, package-lock.json is not included in the repository, so the packages version installed may not quite match with those installed on the developer workdirectory.

Check your environment using node -v && npm -v. This assumes that you have node and npm executable in you OS PATH.

Then assuming that you have cloned the repository, do the following, from project root:

  • If you yarn installed then run yarn install. Otherwise if you have npm then run npm install.
  • node ./bin/index.js and follow the prompt

Folder Structure

- bin  (D) (the CLI executable script)
- src  (D) (all source codes)
- test (D) (test specs)
- package.json (F) (nodejs package manifest)
... (F) (all other supporting files)

Test

Run the script:

npm run test

or to run specific test do:

./node_modules/.bin/ava <test file location>

Check out the docs for ava for details of tests.

Roadmap

  • Add more code coverage.
  • Add custom Error class using helpful error codes to help debugging.
  • Publish the tool as REST API using restify for integrating with any UI that can talk REST.
  • Develop an web app to visualize the scenario and interactive form using React or VueJS.

Contributors

NameWebsite
Miraz Al-Mamunhttps://codarrior.mirazalmamun.xyz

If you would like to contribute, here are some guidelines:

  • Follow clean coding and put docblock using JSDoc format.
  • This project uses prettier and xo for linting.
  • Make sure put right commit message. This gets help from husky.

License

MIT © Miraz Al-Mamun