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

arc-lib

v9.2.0

Published

ARC

Readme

Arc Library (arc-lib)

Arc Library (arc-lib) is a unified collection of modular utilities designed for modern Node.js and browser environments.
Each submodule focuses on a specific domain — from validation and hashing to arrays, dates, and structured error handling — and can be used independently or through this aggregate package.


📦 Installation

npm install arc-lib

🧭 Overview

arc-lib provides an umbrella API that consolidates all core ARC libraries under a single import.
It automatically re-exports each library's default export, along with grouped error classes and utility functions.

Included Modules

| Library | Description | |-----------------------|----------------------------------------------------------------------| | arc-is | Lightweight runtime type checker (is(value) -> string) | | arc-array | Extended array utilities with additional mapping and joining helpers | | arc-check | Simple include/exclude rule engine for string validation | | arc-date | Date/time utilities with timezone formatting and arithmetic | | arc-events | Minimal event emitter for managing async event hooks | | arc-hash | Consistent object, array, and string hashing (MD5, SHA256, Base64) | | arc-object | Object manipulation helpers for key sorting, flattening, and cloning | | arc-promise-queue | Concurrency-safe queue for managing asynchronous tasks | | arc-reg-exp | Collection of pre-built and dynamic regular expression helpers | | arc-router | Lightweight in-memory route matching and pattern parsing | | arc-validate | Strong input validation via validateTypes() | | arc-errors | Structured HTTP-style errors and a generic throwByStatus() helper | | arc-logger | Lightweight, environment-aware logging and profiling |


🚀 Quick Start

Importing the Full Bundle

import ArcLib from 'arc-lib';

const { is, ArcArray, ArcErrors, validateTypes } = ArcLib;

console.log(is(123)); // 'number'

const arr = new ArcArray('A', 'B', 'C');
console.log(arr.joinCallback(v => v.toLowerCase(), '-')); // 'a-b-c'

validateTypes('[email protected]', ['email']); // passes silently

throw new ArcErrors.BadRequest('Missing parameter', { field: 'email' });

Importing Specific Utilities

import { validateTypes, Errors, ArcHash, PromiseQueue } from 'arc-lib';

// Validation
validateTypes('123', ['string']); // Throws if not a string

// Hashing
console.log(ArcHash.sha256('hello world'));

// Promise queue
const queue = new PromiseQueue();
queue.addToQueue(fetch('https://api.example.com/data'));

⚙️ Structure

arc-lib re-exports each module’s primary export for direct use, and also provides a clean default bundle:

import ArcLib, { Errors, validateTypes, ArcHash } from 'arc-lib';

ArcLib.ArcRouter;     // router instance class
ArcLib.validateTypes; // type validation helper
Errors.NotFound;   // structured HTTP error

The default export object has this structure:

{
  is,
  ArcArray,
  ArcCheck,
  ArcDate,
  ArcEvents,
  ArcHash,
  ArcObject,
  PromiseQueue,
  ArcRegExp,
  ArcRouter,
  validateTypes,
  Errors
}

🧩 Example: Custom Error Handling

import { Errors } from 'arc-lib';

try {
  throw new Errors.Unauthorized('Session expired');
} catch (e) {
  if (e.status === 401) {
    console.log('Please reauthenticate');
  }
}

🧪 Example: Promise Queue

import { PromiseQueue } from 'arc-lib';

const queue = new PromiseQueue();
queue.setAllowedActive(2);

queue.addToQueue(new Promise(r => setTimeout(r, 500)));
queue.addToQueue(new Promise(r => setTimeout(r, 500)));
queue.addToQueue(new Promise(r => setTimeout(r, 500)));

await queue.settleQueued();
console.log('All promises settled');

🧠 Example: Date Formatting

import { ArcDate } from 'arc-lib';

const now = new ArcDate();
console.log(now.format('YYYY-MM-DD HH:mm:ss', 'America/New_York'));

🧩 Example: Regex Helper

import { ArcRegExp } from 'arc-lib';

console.log(ArcRegExp.email.test('[email protected]')); // true

📘 License

This project is released under The Unlicense, placing it in the public domain.