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

@mj-studio/js-util

v1.1.22

Published

Custom JavaScript Utilities for MJ Studio

Downloads

12,034

Readme

@mj-studio/js-util

ogimage-1260-630

JS Check

A comprehensive collection of JavaScript utility functions for modern development. Written in TypeScript with full type safety and extensive JSDoc documentation.

Installation

yarn add @mj-studio/js-util
npm install @mj-studio/js-util

API Reference

| Category | Function | Description | |----------------|----------------------------------------------------|------------------------------------------------| | String | camelCase(str) | Converts snake_case or kebab-case to camelCase | | | snakeCase(str) | Converts strings to snake_case format | | | capitalize(str) | Capitalizes the first character | | Object | camelCaseObject(obj) | Recursively converts object keys to camelCase | | | snakeCaseObject(obj) | Recursively converts object keys to snake_case | | | reverseObjectKeyValues(obj) | Swaps keys and values in object | | | replaceJsonKeysRecursively(obj, options) | Replace object keys recursively | | | replaceJsonValuesRecursively(obj, options) | Replace object values recursively | | Array | groupByArray(arr, getKey) | Groups array elements into subarrays | | | groupByObject(arr, getKey) | Groups array elements into object | | | doBatch(arr, work, batchCount) | Processes arrays in batches | | | unique(arr) | Removes duplicate values | | | generateArray(size) | Creates array [0, 1, 2, ..., size-1] | | | randomItem(arr) | Returns random element | | | lastOf(arr) | Returns last element | | | toggled(arr, element) | Toggles element in array | | Promise | withTimeout(ms, promise) | Adds timeout to promises | | | withMinimumResolveTime(ms, promise) | Ensures minimum resolve time | | Type Check | is.string(value) | String type check | | | is.number(value) | Number type check (excludes NaN) | | | is.boolean(value) | Boolean type check | | | is.array(value) | Array type check | | | is.function(value) | Function type check | | | is.object(value) | Object type check (excludes null) | | | is.plainObject(value) | Plain object type check | | | is.null(value) | Null check | | | is.undefined(value) | Undefined check | | | is.nullOrUndefined(value) | Null or undefined check | | | is.falsy(value) | Falsy values check | | | is.truthy(value) | Truthy values check | | | is.notEmptyString(value) | Non-empty string check | | | is.emptyString(value) | Empty string check | | | is.numberString(value) | Numeric string check | | | is.integerString(value) | Integer string check | | | is.notEmptyArray(value) | Non-empty array check | | | is.emptyArray(value) | Empty array check | | | is.promise(value) | Promise check | | Filter | filterJsonKeys(json, keys) | Filter JSON object by keys | | | filterNonNullish(arr) | Remove null/undefined from array | | | filterNonNullishKeys(obj, options) | Remove null/undefined from object | | | removeValueByKeyInObject(obj, key) | Remove specific keys from object | | Number | numberWithComma(num) | Format with thousand separators | | | padZero(num, len) | Pad with leading zeros | | | toFixed(num, digits, default) | Safe toFixed with undefined handling | | | toFixedIfNeed(num, digits) | toFixed that removes trailing zeros | | | toSiUnitString(num) | Convert to SI units (1.5K, 1.5M) | | | clamp(value, min, max) | Clamps value between min and max | | Time | parseSecond(seconds) | Parse seconds into time components | | | formatSec(seconds, format) | Format seconds with various formats | | | createTimer() | Timer management | | | setIntervalWithTimeout(callback, ms) | Clearable intervals | | Math | interpolate(value, inMin, inMax, outMin, outMax) | Linear interpolation | | | interpolateColor(ratio, startColor, endColor) | Color interpolation | | Misc | formatJson(data) | Pretty-print JSON with error handling | | | lastMatchIndex(str, match) | Find last occurrence index |

TypeScript Support

All functions include comprehensive TypeScript type definitions and JSDoc documentation for excellent IDE support.

Contributing

See CONTRIBUTING.md for contribution guidelines.

License

MIT © MJ Studio