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

personalitygen

v0.4.2

Published

Generate simulated character personalities for games, stories, and simulations.

Readme

personalitygen for TypeScript

Generate simulated character personalities for games, stories, and simulations using the Big Five (OCEAN) and Adaptive Bifurcated Big Five (ABBF) models.

The package is dependency-free, ESM-only, browser/bundler friendly, and ships JavaScript plus TypeScript declarations. CI tests the current Node.js LTS and latest release lines.

Install

npm install personalitygen

Generate a character

import {
  AdaptiveBifurcatedProfile,
  BigFivePersonality,
  LifeStage,
} from "personalitygen";

const personality = BigFivePersonality.random(LifeStage.Adult);
const adaptive = AdaptiveBifurcatedProfile.fromBigFive(
  personality.traits,
);

console.log(personality.conflictResolution.style);
console.log(adaptive.vector);
console.log(adaptive.dominantPoles(0.25));

Random factories use Math.random by default. Supply any structural random source when a game or simulation owns randomness:

const rng = {
  uniform(minimum: number, maximum: number): number {
    return minimum + (maximum - minimum) * mySeededRandom();
  },
};

const personality = BigFivePersonality.random(LifeStage.Adult, { rng });

uniform(minimum, maximum) may return either inclusive endpoint and must return a finite value inside the requested range; malformed results raise RangeError. A caller-owned seeded source makes a fixed sequence reproducible within one package version. Outputs from the same integer seed are not guaranteed to remain identical after a later model or algorithm change.

Models

  • BigFiveTraits groups the five OCEAN trait value objects.
  • BigFiveConflictResolution records a style and its derived concern priorities.
  • BigFivePersonality combines BigFiveTraits with BigFiveConflictResolution.
  • AdaptiveBifurcatedProfile represents the signed ABBF vector in canonical order: order, chaos, cooperation, conflict, competition.
  • All exported model instances and enum-like value objects are frozen.
  • Numeric constructors throw RangeError for invalid ranges; categorical constructors throw TypeError for unsupported values.

See the repository documentation for the behavioral specification, Python peer, examples, and contribution guidance.