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

@jarenjs/core

v0.9.2

Published

Jaren Core Functions

Downloads

162

Readme

@jarenjs/core

The zero-dependency foundation of Jaren. Everything the validator, the formats package and the forms package are built on lives here — type guards, Unicode-aware string handling, a large text-validation toolbox, number range helpers, and fixed-point and vector math.

None of it depends on JSON Schema: every module can be used standalone in any JavaScript project.

Modules

| Import | Contents | |---|---| | @jarenjs/core | type guards and getters (isStringType, isObjectClass, getIntegerType, ...) | | @jarenjs/core/array | array helpers (isUniqueArray, getUniqueArray, includesAll, ...) | | @jarenjs/core/object | deep equality (equalsDeep, JSON-only equalsJson), map/set merging | | @jarenjs/core/string | Unicode string helpers (countCodePoints, compareCodePoints, ...), cached regex compilation | | @jarenjs/core/scan | char-code constants and predicates for recursive-descent parsers | | @jarenjs/core/number | boolean/number/integer coercion helpers (isIntishType, ...) | | @jarenjs/core/integer | int8 ... uint64 ranges and validators | | @jarenjs/core/float | float16 ... float64 constants, validators, increment/decrement | | @jarenjs/core/bigint | bigint helpers (BigInt_min, BigInt_MinMax, ...) | | @jarenjs/core/dates | RFC 3339 / ISO 8601 date-time parsing and validation | | @jarenjs/core/text | text validators: emails, hostnames, IPs, URIs/IRIs, UUIDs, punycode, ... | | @jarenjs/core/math | int32/float64 math and 2D/3D vector classes |

Deep imports work too (@jarenjs/core/text/email, @jarenjs/core/math/vec2f64, ...).

Strings and Unicode

@jarenjs/core/string counts string length the way JSON Schema expects — by grapheme cluster, not UTF-16 code units — without paying for Intl.Segmenter unless the string actually needs it:

import { getStringLength, isAsciiString, createRegExp } from '@jarenjs/core/string';

getStringLength('hello', true);       // 5  (ASCII fast path: str.length)
getStringLength('héllo', true);       // 5  (surrogate-aware code point count)
getStringLength('👨‍👩‍👧‍👦', true); // 1  (grapheme segmentation, only when clusters can form)
getStringLength('👨‍👩‍👧‍👦');       // 11 (default: plain UTF-16 length)

createRegExp('^\\p{L}+$');            // cached, unicode-flagged RegExp

Text validation

@jarenjs/core/text is a validation toolbox that backs the @jarenjs/formats package but stands on its own — every function takes a string and returns a boolean, with cheap common-case fast paths before comprehensive parsing:

import { isValidEmail, isValidIdnHostname, isValidIPv6, isValidUriTemplate } from '@jarenjs/core/text';

isValidEmail('"joe bloggs"@example.com'); // true (RFC 5321, quoted-string form)
isValidIdnHostname('실례.테스트');          // true (IDNA contextual rules included)
isValidIPv6('::ffff:192.168.0.1');        // true
isValidUriTemplate('/users{/id}{?q}');    // true (RFC 6570)

Grouped by file: email (RFC 5321 + internationalized addresses), host (hostnames, IDN hostnames, IPv4/IPv6, MAC, URI/URL/IRI and references, URI templates), identifiers (UUID, GUID, C/HTML/CSS identifiers), iregexp (I-Regexp / RFC 9485 validation and translation to RegExp: isValidIRegexp, compileIRegexp), base64, basic (alpha, numeric, hex, web colors), misc (ISBN-10/13, ISO 3166 country codes, IBAN), i18n (Unicode script tests and IDNA context checks) and a complete punycode implementation.

Dates, numbers and math

  • dates — RFC 3339 date/time/date-time validation and parsing into Date (leap years and month lengths included), ISO 8601 durations, and the more lenient ISO date-time forms.
  • integer/float/bigint — range constants and validators for every fixed-width type from int8 to uint64 and float16 to float64, including float increment/decrement in representable steps.
  • math — asm.js-style typed math (Int32, Float64) and vector classes (Vec2i32, Vec2f64, Vec3f64) with a fast integer sine approximation.

JSON addressing standards

The JSON addressing and query standards — JSON validation helpers, JSON Pointer (RFC 6901), the compiling JSONPath engine (RFC 9535), and the Jaren JSON Query language with its XQuery front-end — live in @jarenjs/json. This package supplies their foundations: the char-code scanner (@jarenjs/core/scan), equalsJson deep equality, code-point ordering, and the I-Regexp (RFC 9485) toolbox.

Development

Unit tests live in test/core/ at the repository root (npm run test:core). This package's internals are described in its own ARCHITECTURE document; see the repository README and ARCHITECTURE for the monorepo picture, and the ROADMAP for planned work.