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

stack-glass-problem

v1.0.1

Published

Solving amount of water dispensed in glasses stacked in triangular pattern

Downloads

6

Readme

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

| Name | Website | | ------------------ | ------------------------------------ | | Miraz Al-Mamun | https://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