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

@aamirtech/utils

v0.1.7

Published

Library packed with your basic code utils.

Downloads

58

Readme

aamirtech

@aamirtech/utils

GitHub license Maintainer Downloads Npm package version

Library packed with your basic code utils.

Documentation

The documentation is available at aamir.tech.

Installation

Install with npm

  npm install @aamirtech/utils

Install with yarn

  yarn add @aamirtech/utils

Install with bun

  bun add @aamirtech/utils

Usage

All utility functions use snake_case naming:

import {
  snowflake,           // lowercase object name (with backward compatibility)
  Snowflake,           // alias for backward compatibility
  get_public_id,
  get_initials,
  is_email,
  get_sanitized_email,
  get_base_email,
  to_title_case,
  to_camel_case,
  to_pascal_case,
  to_snake_case,
  to_kebab_case
} from "@aamirtech/utils";

Snowflake ID Generation

// Preferred lowercase naming
console.log(snowflake.generate());
// 7167216930510602240

console.log(snowflake.generate(1));
// 7167216930510602241

// Parse snowflake components
const id = snowflake.generate(1);
const parsed = snowflake.parse(id);
console.log(parsed.nodeId); // 1

// Backward compatibility also supported
console.log(Snowflake.generate()); // Still works

Public ID Generation

// Generate 6-character alphanumeric ID (default)
get_public_id(); // "A3B9C2"

// Generate 10-character numeric ID
get_public_id(10, { numeric: true, alphabetic: false }); // "1234567890"

// Generate 8-character alphabetic ID
get_public_id(8, { numeric: false, alphabetic: true }); // "ABCDEFGH"

Email Validation

// Standard email addresses
is_email("[email protected]"); // true
is_email("[email protected]"); // true

// Plus addressing (email filtering/sub-addressing)
is_email("[email protected]"); // true
is_email("[email protected]"); // true
is_email("[email protected]"); // true
is_email("[email protected]"); // true

// Invalid emails
is_email("invalid-email"); // false
is_email("user@"); // false
is_email("@example.com"); // false
is_email("[email protected]"); // false (plus at start)
is_email("[email protected]"); // false (plus at end)

Email Sanitization

// Remove plus addressing and normalize email
get_sanitized_email("[email protected]"); // "[email protected]"
get_sanitized_email("[email protected]"); // "[email protected]"

// Handle multiple plus signs and dots
get_sanitized_email("[email protected]"); // "[email protected]"
get_sanitized_email("[email protected]"); // "[email protected]"
get_sanitized_email("[email protected]"); // "[email protected]"

// Remove subdomains (optional)
get_sanitized_email("[email protected]", { keepSubdomains: false }); // "[email protected]"

// Simple alias for common use case
get_base_email("[email protected]"); // "[email protected]"

Initials Extraction

get_initials("John Doe"); // "JD"
get_initials("Alice Mary Smith"); // "AS"
get_initials("Bob"); // "B"
get_initials("Mary-Jane Watson"); // "MW"

String Case Conversion

to_title_case("hello_world"); // "Hello World"
to_camel_case("hello_world"); // "helloWorld"
to_pascal_case("hello_world"); // "HelloWorld"
to_snake_case("Hello World"); // "hello_world"
to_kebab_case("Hello World"); // "hello-world"

Tests

Tests are written in Bun Test. To run tests, run the following command:

  bun test

To run tests with coverage, run the following command:

  bun test:coverage

License

MIT

The project contains part based on a fork off of (snowflake-generator)[https://github.com/FatAussieFatBoy/snowflake-generator].