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

@cl3m/corekit

v0.1.1

Published

A general-purpose utility library for strings, arrays, objects, and dates — with a CLI.

Readme

corekit


A general-purpose utility library for strings, arrays, objects, and dates — with a built-in CLI.

TypeScript-first. Zero dependencies. Works in Node.js and the browser (ESM + CJS dual output).


Installation

npm install @cl3m/corekit

Usage

As a library

import { strings, arrays, objects, dates } from "@cl3m/corekit";

strings.slugify("Hello World!");       // "hello-world"
arrays.chunk([1, 2, 3, 4, 5], 2);     // [[1,2],[3,4],[5]]
objects.pick({ a:1, b:2, c:3 }, ["a","c"]); // { a:1, c:3 }
dates.timeAgo(new Date("2024-01-01")); // "X months ago"

Or import modules directly:

import { slugify, toCamelCase } from "@cl3m/corekit/strings";
import { chunk, groupBy } from "@cl3m/corekit/arrays";
import { deepMerge, omit } from "@cl3m/corekit/objects";
import { formatDate, diffDates } from "@cl3m/corekit/dates";

API

@cl3m/corekit/strings

| Function | Description | |---|---| | capitalize(str) | Capitalize first letter | | toCamelCase(str) | Convert to camelCase | | toKebabCase(str) | Convert to kebab-case | | toSnakeCase(str) | Convert to snake_case | | truncate(str, max, ellipsis?) | Truncate with ellipsis | | slugify(str) | URL-safe slug | | countOccurrences(str, sub) | Count substring occurrences | | centerPad(str, width, char?) | Center-pad a string | | isEmail(str) | Validate email format | | stripWhitespace(str) | Remove all whitespace | | reverseString(str) | Reverse a string |

@cl3m/corekit/arrays

| Function | Description | |---|---| | unique(arr) | Remove duplicates | | chunk(arr, size) | Split into chunks | | flatten(arr, deep?) | Flatten nested arrays | | intersection(a, b) | Common elements | | difference(a, b) | Elements in a not in b | | shuffle(arr) | Fisher-Yates shuffle | | groupBy(arr, keyFn) | Group by key function | | sum(arr) | Sum of numbers | | minMax(arr) | { min, max } of numbers | | sample(arr) | Random element | | range(start, end, step?) | Generate number array |

@cl3m/corekit/objects

| Function | Description | |---|---| | deepClone(obj) | Deep clone via JSON | | deepMerge(target, source) | Recursive merge | | pick(obj, keys) | Pick keys | | omit(obj, keys) | Omit keys | | flattenObject(obj) | Dot-notation flatten | | isPlainObject(val) | Plain object check | | isEmpty(obj) | Empty object check | | invertObject(obj) | Swap keys/values | | getByPath(obj, path) | Get value by dot path |

@cl3m/corekit/dates

| Function | Description | |---|---| | formatDate(date, template) | Format with YYYY MM DD HH mm ss | | addToDate(date, n, unit) | Add days/months/years | | diffDates(a, b, unit) | Difference between dates | | isBetween(date, start, end) | Range check | | isSameDay(a, b) | Same calendar day | | timeAgo(date, now?) | Relative time string | | startOf(date, unit) | Start of day/month/year | | isValidDate(val) | Valid Date check |


CLI

npx corekit --help

# Strings
corekit capitalize "hello world"
corekit slugify "Hello World!"
corekit camel "hello-world"
corekit kebab "helloWorld"

# Arrays
corekit chunk 3 a b c d e f
corekit unique a b a c b d
corekit range 1 10
corekit range 0 20 5

# Dates
corekit format 2024-03-15 YYYY/MM/DD
corekit timeago 2024-01-01

Development

npm install
npm run build       # compile to /dist
npm test            # run all tests
npm run test:watch  # watch mode
npm run dev         # build in watch mode

License

MIT


Browser Support

All core modules (strings, arrays, objects, dates) are fully browser-compatible. The CLI is Node.js only.

Via CDN (IIFE global — no bundler needed)

<script src="https://cdn.jsdelivr.net/npm/@cl3m/corekit/dist/browser.global.js"></script>
<script>
  console.log(corekit.strings.slugify("Hello World!"));     // "hello-world"
  console.log(corekit.arrays.chunk([1,2,3,4,5], 2));        // [[1,2],[3,4],[5]]
  console.log(corekit.dates.timeAgo(new Date("2024-01-01"))); // "X months ago"
</script>

Via ESM in modern browsers (no bundler)

<script type="module">
  import { strings, arrays } from "https://cdn.jsdelivr.net/npm/@cl3m/corekit/dist/browser.esm.js";

  console.log(strings.toCamelCase("hello-world")); // "helloWorld"
  console.log(arrays.range(1, 5));                 // [1, 2, 3, 4, 5]
</script>

Via bundler (Vite, Webpack, etc.)

import { strings, arrays, objects, dates } from "@cl3m/corekit/browser";

Visit docs

https://clemdevlin.github.io/corekit-docs