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

@weresk/core

v0.3.1

Published

**@weresk/core** Common utilities and types for the rest of @weresk libraries

Downloads

12

Readme

@weresk/core Common utilities and types for the rest of @weresk libraries

Exports

Types

  • Props
    • DefaultStyleProps: Contains className and style properties
    • DefaultProps: Extends DefaultStyleProps and adds id
    • DefaultPropsWithChildren: Extends DefaultProps and adds children
    • DefaultPageParams: Contains slug and path properties
    • DefaultPageProps: Contains params: DefaultPageParams
    • DefaultLayoutProps: Extends DefaultPageProps and adds children
  • Sanity
    • Span
    • Block
    • ListItem
    • Link
    • Color
    • FileObject
    • ImageObject
    • TableRow
    • TableValue

Utils

  • Arrays
    • pickRandom<T>(array?: T[]): T | undefined: Returns a random element from an array
    • shuffle<T>(array: T[]): T[]: Shuffles an array
  • Objects
    • isObject(item?: any): boolean: Checks if a variable is an object and not an array
    • mapKeys<K extends string, T>(keys: K[], fn: (arg: K) => T): Record<K, T>: Creates an object from an array of keys, using map function
    • mergeDeep(target: object, ...sources: object[]): object: Deeply merges multiple objects
    • objectMap(obj: object, fn: (k: string, v: any, i: number) => any): object: Maps an object
    • purgeEmptyStrings<T extends object>(obj: T): Partial<T>: Converts empty strings in the object values to undefined
  • Styles
    • colorToRGB(color: Color): string: Converts Sanity Color object to R G B string
    • lockBodyScroll(lock = true): Locks and unlocks scroll for HTML body element
  • Text
    • caseTransform(input: string | undefined, transform: "capitalize" | "uppercase" | "lowercase" | "title"): string: Transforms a string case
    • capitalize(input: string | undefined): string: Capitalizes a string
    • title(input: string | undefined): string: Transfrorms a string case to a title case
    • formatKeywords(input: string): string: In a string converts line breaks into commas and cleans up multiple and trailing spaces
    • longestWord(input: string): string: Returns a longest word in a string
    • neatTextBreaks(input?: string, length?: 1 | 2 | 3): string: Inserts a non-breakable space after a short words in a string, replaces dashes with non-breakable hyphems
    • neatChildrenBreaks(children?: React.ReactNode, length?: 1 | 2 | 3): React.ReactNode: Applies neatTextBreaks to all strings inside a React element
    • numeric(input: number | string | undefined): number: Returns a number part of a string, works as well with numbers and undefined values
    • transliterate(input?: string): string: Transliterates cyrillic glyphs in a string
  • Typed
    • getTitleByValue(value?: string, items?: {value: string, title: string}[]): string: Finds a title value for a corresponding value in an array of objects with those keys
    • isIn<FilterType extends string>(filter: FilterType[] | boolean | undefined, value: string | undefined): Checks if a string is an array with typed string literal values
    • toLiteralString<LiteralType extends string>(values: readonly LiteralType[], value: string | undefined): LiteralType | undefined: Converts string to literal type if it is within values
  • Sanity
    • getImageUrlBuilder(source: SanityImageSource): ImageUrlBuilder: Returns a Sanity Image Url Builder object from Sanity Image Source
    • getImageUrl = (source?: SanityImageSource, width?: number, height?: number): string: Returns an URL from Sanity Image Source
    • previewPortableText(input: (Block | object)[] | undefined): string | undefined: Returns a first text element inside a Sanity PortableText object