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

my-dev-utils

v1.0.1

Published

A utility library for developers with string, date, array, and ID helpers

Readme

My Dev Utils - A Simple Utility Library for Developers

My Dev Utils is a collection of simple utility functions for everyday tasks in JavaScript development. This library provides functions to handle tasks such as removing duplicates from arrays, formatting dates, generating unique identifiers, and more.

Installation

To install the library, you can use npm or yarn:

npm install my-dev-utils

or

yarn add my-dev-utils

Functions

1. Array Utilities

removeDuplicates(arr)

Removes duplicates from an array.

  • Parameters:

    • arr (Array): The array from which duplicates will be removed.
  • Returns: A new array with unique values.

Example:

const { removeDuplicates } = require('my-dev-utils').arrayUtils;

const arr = [1, 2, 2, 3, 4, 4, 5];
console.log(removeDuplicates(arr));  // Output: [1, 2, 3, 4, 5]

groupBy(arr, key)

Groups an array of objects by a specific key.

  • Parameters:

    • arr (Array): The array of objects to be grouped.
    • key (string): The key to group by.
  • Returns: An object where each key is the value of the specified key in the original objects, and the values are arrays of objects that share the same key.

Example:

const { groupBy } = require('my-dev-utils').arrayUtils;

const objects = [
{ id: 1, category: 'A' },
{ id: 2, category: 'B' },
{ id: 3, category: 'A' },
];
console.log(groupBy(objects, 'category'));
// Output: { A: [{ id: 1, category: 'A' }, { id: 3, category: 'A' }], B: [{ id: 2, category: 'B' }] }

2. Date Utilities

formatDate(date, formatString = "dd/MM/yyyy")

Formats a date using the given format string.

  • Parameters:

    • date (Date | string): The date to be formatted.
    • formatString (string): The format string (default is "dd/MM/yyyy").
  • Returns: A string representing the formatted date.

Example:

const { formatDate } = require('my-dev-utils').dateUtils;

const formattedDate = formatDate(new Date(), 'yyyy-MM-dd');
console.log(formattedDate);  // Example output: 2024-11-12

daysBetween(date1, date2)

Calculates the number of days between two dates.

  • Parameters:

    • date1 (Date | string): The first date.
    • date2 (Date | string): The second date.
  • Returns: The number of days between the two dates.

Example:

const { daysBetween } = require('my-dev-utils').dateUtils;

const days = daysBetween('2024-11-10', '2024-11-12');
console.log(days);  // Output: 2

3. UUID Utilities

generateUUID()

Generates a unique identifier (UUID).

  • Returns: A string representing the generated UUID.

Example:

const { generateUUID } = require('my-dev-utils').uuidUtils;

const uuid = generateUUID();
console.log(uuid);  // Output: 'e1b0f459-f56b-4d5e-b083-0813214e6b06'

generateAlphanumericId(length = 8)

Generates an alphanumeric identifier of a given length.

  • Parameters:

    • length (number): The length of the identifier (default is 8).
  • Returns: A string representing the alphanumeric identifier.

Example:

const { generateAlphanumericId } = require('my-dev-utils').uuidUtils;

const id = generateAlphanumericId(10);
console.log(id);  // Output: 'jX7V4BZs93'

4. String Utilities

capitalize(str)

Capitalizes the first letter of a string.

  • Parameters:

    • str (string): The string to be capitalized.
  • Returns: The string with the first letter capitalized.

Example:

const { capitalize } = require('my-dev-utils').stringUtils;

const capitalized = capitalize("hello world");
console.log(capitalized);  // Output: 'Hello world'

isPalindrome(str)

Checks if a string is a palindrome.

  • Parameters:

    • str (string): The string to check.
  • Returns: A boolean value indicating whether the string is a palindrome.

Example:

const { isPalindrome } = require('my-dev-utils').stringUtils;

console.log(isPalindrome('madam'));  // Output: true
console.log(isPalindrome('hello'));  // Output: false

License

OPEN SOURCE PROJECT MAKE WITH ❤ BY DEKHIL OMRAN