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

demotivator

v14.1.1

Published

A TypeScript library containing 500+ hand-curated insults organized into themed packs, along with utilities to generate, search, and transform them.

Readme

demotivator.js

Hand-curated insult packs and generation utilities for JavaScript/TypeScript.

Part of the (de)Motivator monorepo by PorkyProductions.

npm TypeScript License


Description

demotivator is a TypeScript library containing 500+ hand-curated insults organized into themed packs, along with utilities to generate, search, and transform them.

Documentation

Full documentation at demotivator.web.app/docs/demotivator.

Installation

npm install demotivator

Quick Start

import { generateInsult, purify, makeAngry, createArray } from 'demotivator';

// Random insult from the original pack
const insult = generateInsult();

// Censor profane words
const clean = purify(insult, '#');

// Make it ANGRY
const angry = makeAngry(clean, 5);

// Combine multiple packs
const custom = createArray({ packs: ['original', 'halloween'] });
const scary = generateInsult(custom);

Insult Packs

| Key | Description | Explicit | |---|---|---| | original | The standard insult collection | No | | profane | Adult-only insults with profanity | Yes | | halloween | Spooky seasonal insults | No | | christmas | Holiday-themed insults | No | | valentines | Valentine's Day insults | No | | stPatricks | St. Patrick's Day insults | No |

API

generateInsult(array?)

Returns a random insult from array. Defaults to the original pack.

import { generateInsult, insults } from 'demotivator';

generateInsult();         // random from original pack
generateInsult(insults);  // random from all insults combined

insultAt(position, array?)

Returns the insult at a 1-based position. Defaults to the original pack.

import { insultAt } from 'demotivator';

insultAt(1); // first insult in the original pack

searchInsults(term, array?, withPosition?)

Returns the most relevant insult matching term. Pass withPosition: true to also get the 1-based position.

import { searchInsults } from 'demotivator';

const insult = searchInsults('ugly');
const result = searchInsults('ugly', undefined, true);
// { insult: '...', position: 42 }

Relevance is ranked: exact match → prefix match → whole-word match → substring match.


createArray(config)

Builds a custom insult array from one or more packs. Supports mixing built-in packs with custom ones.

import { createArray } from 'demotivator';

const array = createArray({ packs: ['original', 'halloween'] });

const withCustom = createArray({
	packs: ['original'],
	customPacks: [{
		key: 'mine',
		title: 'My Pack',
		explicit: false,
		insults: ['You use spaces instead of tabs.']
	}]
});

defineCustomPack(pack)

TypeScript identity helper — returns its argument typed as InsultPack for full inference.

import { defineCustomPack } from 'demotivator';

const myPack = defineCustomPack({
	key: 'mine',
	title: 'My Pack',
	explicit: false,
	insults: ['You use spaces instead of tabs.']
});

packInfo(insult | position | searchResult, array?)

Returns metadata about which pack an insult belongs to and its position within it.

import { generateInsult, packInfo } from 'demotivator';

const insult = generateInsult();
const info = packInfo(insult);
// { insult, packKey, packTitle, explicit, position }

purify(insult, symbol?)

Masks profane words. Default symbol is *.

import { purify } from 'demotivator';

purify('You dumb ass.', '#'); // 'You dumb ###.'

porkify(insult, amount?)

Inserts 'Porky' into random positions in the insult. Default amount is 1.

import { porkify } from 'demotivator';

porkify('You are terrible.', 2); // 'You Porky are Porky terrible.'

makeAngry(insult, exclamationCount?)

Uppercases the insult, strips trailing punctuation, and appends exclamation marks. Default count is 3.

import { makeAngry } from 'demotivator';

makeAngry('You are awful.', 5); // 'YOU ARE AWFUL!!!!!'

Object / Class API

All functions are also available on the deMotivator default export object or the DeMotivator class:

import deMotivator, { DeMotivator } from 'demotivator';

deMotivator.generateInsult();

const dm = new DeMotivator();
dm.generateInsult();

Raw Data Exports

| Export | Description | |---|---| | insults | All insults combined | | profaneInsults | Explicit insults only | | halloweenInsults | Halloween pack | | christmasInsults | Christmas pack | | valentinesInsults | Valentine's Day pack | | stPatricksInsults | St. Patrick's Day pack | | insultPacks | Map of all packs keyed by pack key | | insultPackList | Array of all pack objects |


License

ISC — see the LICENSE file for details.