Showcase/Bullshit.js
Generated Apr 26, 2026, 5:16 PM

Project Overview

What this project actually is

Bullshit.js is a JavaScript bookmarklet that identifies and highlights specific "bullshit" terms within the text content of a web page.

Tech stack

  • JavaScript
  • esbuild (for bundling)
  • eslint (for linting)
  • findandreplacedomtext (library for DOM manipulation)

High-level architecture

The core logic resides in src/replace.js. This file imports a list of terms from src/terms.js. It then uses the findandreplacedomtext library to find occurrences of these terms within the document.body. When a term is found, the revealBullshit function is called to replace the original text with a modified version, wrapped in an <abbr> tag with a red style. The package.json defines build scripts using esbuild to bundle src/replace.js into the bullshit.js file, which is the output for the bookmarklet.

Entry points

  1. src/replace.js: This is the main source file for the bookmarklet's logic. When the bookmarklet is executed, this script is loaded and run in the context of the current web page.
  2. bullshit.js: This is the bundled output file. It's the script that is directly included in the bookmarklet's href attribute (as seen in index.html). When the bookmarklet is clicked, this script is fetched and executed, triggering the DOM manipulation defined in src/replace.js.
  3. index.html: This file serves as a landing page that explains what Bullshit.js is and provides the bookmarklet link. It also includes a debug.html which directly includes the bullshit.js script for testing purposes.

Key concepts

  1. src/terms.js: This file contains a large array of regular expressions that define the "bullshit" terms to be detected. Understanding the structure and content of this file is crucial for knowing what the script targets.
  2. src/replace.js:
    • bullshitRe: This regular expression is constructed from bullshitTerms and is used to find the target words in the DOM.
    • revealBullshit({text}): This function takes the matched text, applies some simple transformations (e.g., adding "ting" or "ted"), and returns an <abbr> element with a red style and the transformed text as its content. This is how the "bullshit" is visually identified on the page.
  3. findandreplacedomtext: This external library is the workhorse for modifying the DOM. The script uses its findAndReplaceDOMText function with the document.body as the target, the bullshitRe as the search pattern, and revealBullshit as the replacement function.
  4. Bookmarklet Structure (index.html): The index.html file demonstrates how the bullshit.js script is intended to be used as a bookmarklet. The javascript:(function(){...}()) structure shows how to dynamically create and append a script tag to the current page's DOM.

What is in this showcase?

A JavaScript library with the mission-critical purpose of translating marketing-speak into human-readable text. Every page here was generated from the source repository: the overview, one page per module, and the file paths each claim is based on. Nothing was written by hand, and nothing requires an account to read.

Generated pages
4
Latest generation
Apr 26, 2026

How are these docs generated?

ShipDocs indexes the repository, plans one module per component, writes each page from the real code with cited file paths, then re-generates the pages a commit changed. The module plan and the citations you see here are the same ones the product produces for a private repository.

Can I do this for my own repository?

Yes. Import a GitHub, GitLab, or Bitbucket repository and you get the same structure for your code, plus cited chat and an MCP endpoint for coding agents. Start with the free trial (no card) and keep the Markdown either way: generate docs for your own repository.

What other repositories are documented here?

Browse every live documentation example · Run a free analysis on your own repo

By The ShipDocs team · Reviewed