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

@firecamp/utils

v0.0.24

Published

Utils functions

Readme

@firecamp/utils

Usage

import { _array, _object } from '@firecamp/utils';

API

Array

/**
 * Creates an array excluding all given values using SameValueZero for equality comparisons.
 *
 * @reference https://lodash.com/docs/4.17.15#without
 */
export type TWithout = (
  array: any[],
  element: string | number | Function
) => (string | number)[];

/**
 * This method is like _.sortBy except that it allows specifying the sort orders of
 * the iteratees to sort by. If orders is unspecified, all values are sorted in ascending order.
 * Otherwise, specify an order of "desc" for descending or "asc" for ascending sort order
 * of corresponding values.
 *
 * @reference https://lodash.com/docs/4.17.15#orderBy
 */
export type TOrderBy = (
  array: object[],
  iteratee: string | Function,
  order: 'asc' | 'desc'
) => object[];

/**
 * Creates an object composed of keys generated from the results of running each element of
 * collection thru iteratee. The corresponding value of each key is the last element responsible
 * for generating the key. The iteratee is invoked with one argument: (value).
 *
 * @reference https://lodash.com/docs/4.17.15#keyBy
 */
export type TKeyBy = (array: object[], prop: string) => object;

/**
 * Removes elements from array corresponding to indexes and returns an array of elements without values exist at indexes.
 *
 */
export type TRemoveItem = (array: any[], index: number) => any[];

/**
 * This method is like _.uniq except that it accepts iteratee which is invoked for each element in array to generate
 * the criterion by which uniqueness is computed. The order of result values is determined by the order they occur in the array.
 * The iteratee is invoked with one argument: (value).
 *
 * @reference https://lodash.com/docs/4.17.15#uniqBy
 */
export type TUniqBy = (
  array: any[],
  iteratee: string | number | Function
) => any[];

Object

import { Options } from 'deepmerge'

/**
 * Gets the size of collection by returning its length for array-like values or 
 * the number of own enumerable string keyed properties for objects.
 * 
 * @reference https://lodash.com/docs/4.17.15#size
 */
export type TSize = (object: object) => number

/**
 * Checks if path is a direct property of object.
 * 
 * @reference https://lodash.com/docs/4.17.15#has
 */
export type THas = (object: object, prop: string | number) => boolean

/**
 * The opposite of _object.pick; this method creates an object composed of the own and 
 * inherited enumerable property paths of object that are not omitted.
 */
export type TOmit = (object: object, paths: string[]) => object

/**
 * Creates an object composed of the picked object properties.
 * 
 * @reference https://lodash.com/docs/4.17.15#pick
 */
export type TPick = (object: object, properties: string[]) => object

/**
 * Checks if value is the language type of Object. (e.g. objects)
 * note: return false if an object is an array
 * 
 * @reference https://lodash.com/docs/4.17.15#isObject
 */
export type TIsObject = (object: any) => boolean

/**
 * Merges the enumerable properties of two or more objects deeply.
 * 
 * @reference https://www.npmjs.com/package/deepmerge
 */
export type TMergeDeep = (target: object, source: object, cleanDeep?: boolean, options?: Options) => object

/**
 * return the object which contains the changes performed into the new object
 */
export type TDifference = (oldObject: object, newObject: object) => object

/**
 * return the list of paths from the object which path value matched with the passed value
 */
export type TValuePath = (object: object, value: any, currentPath: string) => string[]

/**
 * return the object after removing the specific characters from the 
 * object properties to the n-th level
 */
export type TOmitCharsFromProp = (object: object, chars?: string[]) => object