1.0.1 • Published 5 months ago

galactic-weight-scale v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

Galactic Weight Scale

A simple npm package that calculates a person's weight on different planets in our solar system.

šŸŒ Features

  • Get your weight on Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune.
  • Simple and lightweight utility for space-related projects.
  • Handles invalid input gracefully.

šŸ“¦ Installation

npm install galactic-weight-scale

šŸš€ Usage

Import the package

const {
  weightOnMercury,
  weightOnVenus,
  weightOnEarth,
  weightOnMars,
  weightOnJupiter,
  weightOnSaturn,
  weightOnUranus,
  weightOnNeptune,
} = require("galactic-weight-scale");

Call the functions

console.log(weightOnMars(75)); // Output: Weight on Mars
console.log(weightOnJupiter(75)); // Output: Weight on Jupiter
console.log(weightOnVenus("invalid")); // Output: null (invalid input handled)

šŸ“– Available Functions

Each function takes a weight in kg (number) as input and returns the weight on the respective planet (rounded to 2 decimal places).

FunctionPlanet
weightOnMercury()Mercury
weightOnVenus()Venus
weightOnEarth()Earth
weightOnMars()Mars
weightOnJupiter()Jupiter
weightOnSaturn()Saturn
weightOnUranus()Uranus
weightOnNeptune()Neptune

Example Output

console.log(weightOnMars(70)); // 26.47
console.log(weightOnJupiter(70)); // 176.86
console.log(weightOnEarth(70)); // 70.00

šŸ›  Contributing

Feel free to fork, open issues, or submit PRs!

šŸ“œ License

This project is licensed under the ISC License.


šŸš€ Created by Yaseen Sidhik

1.0.1

5 months ago

1.0.0

5 months ago