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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@cactusninja______/unit-converter

v1.0.0

Published

Cette librairie propose plusieurs outils et fonctionnalités, notamment des conversions de températures, longueurs, volumes et poids.

Readme

Librairie de Conversion et Utilitaires

Cette librairie propose plusieurs outils et fonctionnalités, notamment des conversions de températures, longueurs, volumes et poids.

Fonctionnalités

1. Conversion de Températures

  • Conversion entre Celsius, Kelvin et Fahrenheit dans les deux sens.

2. Conversion de Longueurs

  • Conversion entre mètres et pieds.
  • Conversion entre kilomètres et miles.
  • Conversion entre yards, mètres et pieds.

3. Conversion de Volumes

  • Conversion entre litres et gallons.
  • Conversion entre millilitres et onces liquides.
  • Conversion entre mètres cubes et pieds cubes.

4. Conversion de Poids

  • Conversion entre kilogrammes et livres.
  • Conversion entre grammes et onces.
  • Conversion entre tonnes métriques et tonnes impériales.

Installation

Assurez-vous d'avoir Node.js et npm installés sur votre machine.

  1. Clonez le dépôt ou mettez-le à jour avec git pull :

    git pull
  2. Installez les dépendances :

    npm install

Utilisation

Importez les fonctions nécessaires dans votre projet TypeScript ou JavaScript :

Exemple : Conversion de Températures

import {
    celsiusToKelvin,
    kelvinToCelsius,
    celsiusToFahrenheit,
    fahrenheitToCelsius,
} from './src/converters/temperature';

console.log(celsiusToKelvin(0)); // 273.15
console.log(fahrenheitToCelsius(32)); // 0

Exemple : Conversion de Longueurs

import {
    metersToFeet,
    feetToMeters,
    kilometersToMiles,
    milesToKilometers,
} from './src/converters/length';

console.log(metersToFeet(1)); // 3.28084
console.log(kilometersToMiles(5)); // 3.106855

Exemple : Conversion de Volumes

import {
    litersToGallons,
    gallonsToLiters,
} from './src/converters/volume';

console.log(litersToGallons(1)); // Exemple : 0.264172
console.log(gallonsToLiters(1)); // Exemple : 3.78541

Exemple : Conversion de Poids

import {
    kilogramsToPounds,
    poundsToKilograms,
} from './src/converters/weight';

console.log(kilogramsToPounds(1)); // Exemple : 2.20462
console.log(poundsToKilograms(1)); // Exemple : 0.453592

Tests

Les tests sont écrits avec Vitest. Pour exécuter les tests, utilisez la commande suivante :

npm test

Structure du Projet

/src
  /converters
    temperature.ts       # Fonctions de conversion de températures
    length.ts            # Fonctions de conversion de longueurs
    volume.ts            # Fonctions de conversion de volumes
    weight.ts            # Fonctions de conversion de poids
/tests
  temperature.test.ts    # Tests unitaires pour les conversions de températures
  length.test.ts         # Tests unitaires pour les conversions de longueurs
  volume.test.ts         # Tests unitaires pour les conversions de volumes
  weight.test.ts         # Tests unitaires pour les conversions de poids

Contributions

Les contributions sont les bienvenues ! Veuillez soumettre une pull request ou ouvrir une issue pour signaler un problème.

Licence

Ce projet est sous licence MIT.