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

@fekit/utils

v6.1.0

Published

Lightweight TypeScript utility library for frontend projects.

Readme

@fekit/utils

Lightweight TypeScript utility library for frontend projects.

@fekit/utils provides small helpers for type checks, data cleanup, enum-tree lookup, date formatting, validation, display formatting, object diffing, number padding, and runtime environment detection.

For AI and LLM usage, read AI_CONTEXT.md. It contains the complete API map, usage guidance, edge cases, and examples.

Install

yarn add @fekit/utils
npm i @fekit/utils

Import

import { idate, format, validate, isString, deepcopy } from '@fekit/utils';

All public APIs are exported from the package root.

API Areas

Type Checks

import {
  getType,
  isFunction,
  isObject,
  isArray,
  isUndefined,
  isNull,
  isString,
  isBoolean,
  isNumber,
  isDate,
  isDateString,
  isElement,
  isNodeList,
  isEmpty,
  isBase64,
  isBlob,
  isJsonString,
  isArrayString,
  isObjectString,
  isEncoded,
  hasOwnProp,
} from '@fekit/utils';
isEmpty(''); // true
isEmpty(0); // false
isDateString('2025-02-31'); // false
hasOwnProp({ name: 'fekit' }, 'name'); // true

Data Helpers

import { deepcopy, cleandata, findByJson, filterJson, dataToEnum, getFileType, findEnumName } from '@fekit/utils';
cleandata({ name: '  Alice  ', empty: '', tags: ['x', ''] });
// { name: 'Alice', tags: ['x'] }

getFileType('/files/report.pdf?download=1');
// 'pdf'

Date Helpers

import { idate } from '@fekit/utils';
idate('2026-06-25').format('YYYY-MM-DD'); // '2026-06-25'
idate('20260817').format('YYYY-MM-DD'); // '2026-08-17'
idate(20260817).format('YYYY-MM-DD'); // '2026-08-17'
idate('2026年8月17日').format('YYYY-MM-DD'); // '2026-08-17'
idate('17/08/2026', { format: 'DD/MM/YYYY' }).format('YYYY-MM-DD'); // '2026-08-17'
idate('2026-06-25').update({ d: 1 }).format('YYYY-MM-DD'); // '2026-06-26'
idate(Date.now()).humanized(); // relative time string

idate() returns an IDate instance with .format(), .update(), .humanized(), and .calendar().

Validation

import { validate, validateEmail, validateNumber, verify } from '@fekit/utils';
validate('email', '[email protected]'); // true
validateEmail('[email protected]'); // true
validateNumber('12.5'); // true

verify(form, data, route) validates form-field configs and returns an array of error objects.

Formatting

import { format } from '@fekit/utils';
format.toPhoneNumber('13800138000'); // '138-0013-8000'
format.toThousands(1234567.89); // '1,234,567.89'
format.toFillZero(8, 3); // '008'

Diff And Fill

import { diff, fill } from '@fekit/utils';
diff({ a: 1 }, { a: '1' }); // []
diff({ a: 1 }, { a: '1' }, true); // [{ field: 'a', lhs: 1, rhs: '1', path: ['a'] }]
fill({ a: 1 }, { a: 2, b: 3 }); // { a: 1, b: null }

Number Helpers

import { numfill } from '@fekit/utils';
numfill(7); // '07'
numfill(-7); // '-07'

Environment Detection

import { env, useEnvInfo, createEnvInfo } from '@fekit/utils';
env.mobile; // dynamically computed boolean
useEnvInfo(); // full runtime environment state
createEnvInfo({ userAgent: 'Mozilla/5.0 ...', hasWindow: true, hasDocument: true });

AI-Friendly Files

  • AI_CONTEXT.md: complete machine-readable API guide.
  • llms.txt: curated LLM entry file that can be published at a website root as /llms.txt.

Notes

  • The package has no runtime dependencies.
  • format is an object of formatter methods, not a function.
  • diff() uses loose string comparison by default. Pass true or { strict: true } for strict comparison.
  • idate() accepts valid Date, date strings (YYYY-MM-DD, YYYY/MM/DD, ISO, YYYYMMDD, Chinese 2026年8月17日), 8-digit YYYYMMDD numbers, undefined for now, and 10-13 digit timestamps. Day-first DD/MM/YYYY requires { format: 'DD/MM/YYYY' }.