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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@meindonsa/js-utils

v1.0.0

Published

A comprehensive TypeScript utility library for Angular, Vue, and React projects

Readme

@meindonsa/js-utils

Une librairie TypeScript complète d'utilitaires pour vos projets Angular, Vue et React.

npm version License: GPLv3

📦 Installation

npm install @meindonsa/js-utils

ou avec yarn :

yarn add @meindonsa/js-utils

✨ Fonctionnalités

  • 🎯 Tree-shaking : Importez uniquement ce dont vous avez besoin
  • 📘 TypeScript natif : Typage complet et IntelliSense
  • 🔧 ESM & CommonJS : Compatible avec tous les systets de modules
  • Testé : Couverture de tests complète
  • 📚 Documentation : Documentation auto-générée avec TypeDoc
  • 🚀 Zéro dépendance : Aucune dépendance externe

📖 Modules disponibles

📁 File (Fichiers)

Utilitaires pour la manipulation de fichiers, images, vidéos et PDFs.

import { formatFileSize, isImage, fileToBase64, downloadFile } from '@meindonsa/js-utils/file';

// Formater la taille d'un fichier
formatFileSize(1048576); // '1.00 MB'

// Vérifier le type de fichier
isImage('image/jpeg'); // true

// Convertir un fichier en base64
const base64 = await fileToBase64(file);

// Télécharger un fichier
downloadFile(blob, 'document.pdf');

📅 Date

Utilitaires pour la manipulation de dates et heures.

import { formatDate, addDays, diffInDays, isToday } from '@meindonsa/js-utils/date';

// Formater une date
formatDate(new Date(), 'DD/MM/YYYY'); // '15/01/2024'

// Ajouter des jours
const futureDate = addDays(new Date(), 7);

// Différence en jours
diffInDays(date1, date2); // 5

// Vérifier si c'est aujourd'hui
isToday(new Date()); // true

✅ Validation

Utilitaires pour la validation de données.

import { isValidEmail, validatePassword, isValidUrl } from '@meindonsa/js-utils/validation';

// Valider un email
isValidEmail('[email protected]'); // true

// Valider un mot de passe
const result = validatePassword('MyP@ssw0rd', {
  minLength: 8,
  requireUppercase: true,
  requireNumbers: true,
});
// { isValid: true, errors: [] }

// Valider une URL
isValidUrl('https://example.com'); // true

🎨 Format

Utilitaires pour le formatage de nombres, devises et texte.

import { formatCurrency, truncate, toTitleCase, slugify } from '@meindonsa/js-utils/format';

// Formater une devise
formatCurrency(1234.56, 'EUR', 'fr-FR'); // '1 234,56 €'

// Tronquer du texte
truncate('Hello World', 8); // 'Hello...'

// Convertir en Title Case
toTitleCase('hello world'); // 'Hello World'

// Créer un slug
slugify('Hello World!'); // 'hello-world'

🎲 Random

Utilitaires pour la génération de valeurs aléatoires.

import {
  randomNumeric,
  randomAlpha,
  randomAlphanumeric,
  randomUuid,
} from '@meindonsa/js-utils/random';

// Générer un code numérique
randomNumeric(6); // '472819'

// Générer du texte alphabétique
randomAlpha(8); // 'jkdfhqlm'

// Générer du texte alphanumérique
randomAlphanumeric(10); // 'a3k9d2h5l7'

// Générer un UUID
randomUuid(); // '550e8400-e29b-41d4-a716-446655440000'

🔍 Array

Utilitaires pour la recherche et manipulation de tableaux.

import { findByProperty, unique, groupBy, sortBy } from '@meindonsa/js-utils/array';

// Rechercher par propriété
const user = findByProperty(users, 'id', 2);

// Supprimer les doublons
unique([1, 2, 2, 3, 3, 4]); // [1, 2, 3, 4]

// Grouper par propriété
const grouped = groupBy(users, 'role');

// Trier par propriété
const sorted = sortBy(items, 'age', 'desc');

🎯 Utilisation

Import global

import * as Utils from '@meindonsa/js-utils';

Utils.formatDate(new Date(), 'YYYY-MM-DD');
Utils.isValidEmail('[email protected]');

Import par module (recommandé pour le tree-shaking)

import { formatDate, addDays } from '@meindonsa/js-utils/date';
import { isValidEmail } from '@meindonsa/js-utils/validation';

Import avec namespace

import { DateUtils, ValidationUtils } from '@meindonsa/js-utils';

DateUtils.formatDate(new Date(), 'YYYY-MM-DD');
ValidationUtils.isValidEmail('[email protected]');

🔧 Développement

Installation des dépendances

npm install

Build

npm run build

Tests

# Lancer tous les tests
npm test

# Tests en mode watch
npm run test:watch

# Couverture de code
npm run test:coverage

Documentation

npm run docs

La documentation sera générée dans le dossier docs/.

📝 Scripts disponibles

  • npm run build : Compile la librairie (ESM, CJS et types)
  • npm test : Lance les tests
  • npm run test:watch : Lance les tests en mode watch
  • npm run test:coverage : Génère un rapport de couverture
  • npm run docs : Génère la documentation
  • npm run clean : Nettoie le dossier dist

🤝 Contribution

Les contributions sont les bienvenues ! N'hésitez pas à ouvrir une issue ou une pull request.

  1. Fork le projet
  2. Créez votre branche (git checkout -b feature/AmazingFeature)
  3. Committez vos changements (git commit -m 'Add some AmazingFeature')
  4. Push vers la branche (git push origin feature/AmazingFeature)
  5. Ouvrez une Pull Request

📄 License

GPL-3.0 © [Your Name]

🔗 Liens