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

@humanjs/core

v0.7.0

Published

Personality system, timing math, types, and plugin contract for HumanJS.

Downloads

1,220

Readme

@humanjs/core

The core of HumanJS: personality system, timing math, types, and the plugin contract.

Most users don't install this package directly. Install @humanjs/playwright instead, which depends on this.

Install

pnpm add @humanjs/core

Authoring a personality

A Personality is plain, immutable data — it describes the rhythm and shape of humanization (mouse curvature, typing delays, reading speed, dwell) without owning any randomness. The Personality type is exported and stable, so anyone can build one and pass it to createHuman({ personality }).

The simplest form extends a built-in preset and overrides only what you want:

import type { PersonalityExtension } from '@humanjs/core';

export const grandma: PersonalityExtension = {
  extends: 'careful',
  name: 'grandma',
  speed: 1.7, // ~70% slower overall
  mouse: { curvature: 0.95, overshootProbability: 0.4 },
  typing: { baseDelayMs: 240, thinkPauseProbability: 0.4, typoProbability: 0.08 },
  reading: { wpm: 130 },
};

You can also export a fully built Personality (every facet specified) — useful when you don't want to inherit from a preset. Compose presets with blend(), and resolve any config to a flat Personality with resolvePersonality().

Publish it as a community package

Personalities are a first-class extension point. To share one, publish a package named @yourname/personality-<name> whose entry exports the object:

// @yourname/personality-grandma
export { grandma } from './grandma';
// consumer
import { grandma } from '@yourname/personality-grandma';
import { createHuman } from '@humanjs/playwright';

const human = await createHuman(page, { personality: grandma });

A runnable example lives in examples/personality-grandma.ts.

Writing a plugin

A HumanPlugin is a plain object with optional lifecycle hooks the host calls around every action. Hooks are observation-only in v1 (they can't transform actions) and run in registration order; each may be sync or async.

import type { HumanPlugin } from '@humanjs/core';

const logger: HumanPlugin = {
  name: 'logger',
  install: (ctx) => console.log(`personality: ${ctx.personality.name}`),
  beforeAction: (action) => console.log(`▶ ${action.type}`, action.params),
  afterAction: (action, result) => console.log(`✓ ${action.type} — ${result.durationMs}ms`),
  onError: (action, error) => console.error(`✕ ${action.type}`, error),
};

const human = await createHuman(page, { plugins: [logger] });

install receives a PluginContext (the resolved personality and the session's seeded rng). A runnable example lives in examples/plugin-logger.ts.

License

MIT