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

@remix-run/assert

v0.2.0

Published

Node assert-compatible utilities for any JavaScript environment

Readme

assert

A compatible subset of node:assert/strict that works in any JavaScript environment, including browsers — plus a vitest-/jest-style expect API for tests that prefer chainable matchers.

Uses strict equality (===) for all comparisons — no type coercion.

Features

  • AssertionError — compatible with node:assert.AssertionError (actual, expected, operator, name)
  • assert.ok — truthy check
  • assert.equal / assert.notEqual — strict equality (=== / !==)
  • assert.deepEqual / assert.notDeepEqual — recursive strict deep equality
  • assert.match — string matches a regexp
  • assert.fail — unconditional failure
  • assert.throws — synchronous throw assertion with optional error validation
  • assert.rejects — async rejection assertion with optional error validation
  • expect(value) — chainable matchers with .not, .rejects, .resolves, plus expect.objectContaining(...) for partial matches

Installation

npm i remix

Usage

Mirrors node:assert/strict — uses strict equality (===), so 1 !== '1' and null !== undefined.

import assert from 'remix/assert'

assert.ok(true)
assert.equal(1, 1)
assert.equal(1, '1') // throws — different types
assert.notEqual('a', 'b')
assert.deepEqual({ a: 1 }, { a: 1 })
assert.deepEqual({ a: 1 }, { a: '1' }) // throws — different types
assert.match('hello world', /world/)
assert.fail('should not reach here')

await assert.rejects(() => Promise.reject(new Error('oops')))
assert.throws(() => {
  throw new TypeError('bad')
}, TypeError)

assert.throws(
  () => {
    let error = new Error('Invalid value') as Error & { code: string }
    error.code = 'ERR_INVALID_ARG_VALUE'
    throw error
  },
  { code: 'ERR_INVALID_ARG_VALUE', message: /Invalid value/ },
)

Named exports

Each assertion is also exported as a named function:

import {
  ok,
  assert, // alias of ok()
  equal,
  notEqual,
  deepEqual,
  notDeepEqual,
  match,
  fail,
  throws,
  rejects,
} from 'remix/assert'

expect

A vitest-/jest-style chainable matcher API on top of the same AssertionError. Use .not to negate, .rejects / .resolves to assert on a promise. Mock-aware matchers work with mock.fn() / mock.method() from @remix-run/test.

import { expect } from 'remix/assert'

expect(value).toBe(42)
expect({ a: 1, b: 2 }).toEqual({ a: 1, b: 2 })
expect({ a: 1, b: 2 }).toEqual(expect.objectContaining({ a: 1 }))
expect({ a: { b: 1, c: 2 } }).toMatchObject({ a: { b: 1 } })
expect(value).not.toBeNull()
expect(arr).toHaveLength(3)
expect(spy).toHaveBeenCalledWith('hello', 1)

await expect(fetch('/missing')).rejects.toThrow('Not found')
await expect(loadModule()).resolves.toBeUndefined()

Available matchers:

| Group | Matchers | | --------------- | ------------------------------------------------------------------------------------------------------------------------ | | Equality | toBe, toEqual, toBeNull, toBeUndefined, toBeDefined, toBeTruthy, toBeInstanceOf | | Numbers | toBeGreaterThan, toBeGreaterThanOrEqual, toBeLessThan, toBeLessThanOrEqual, toBeCloseTo | | String/iterable | toContain, toMatch, toHaveLength | | Object shape | toHaveProperty(path, value?), toMatchObject(partial) | | Throwing | toThrow(expected?) | | Mock-aware | toHaveBeenCalled, toHaveBeenCalledTimes(n), toHaveBeenCalledWith(...args), toHaveBeenNthCalledWith(nth, ...args) |

expect.objectContaining(partial) is an asymmetric matcher recognized by toEqual (and any matcher that uses deep equality under the hood). It passes when the actual value has at least the keys in partial with matching values — extra keys are allowed.

License

See LICENSE