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 🙏

© 2025 – Pkg Stats / Ryan Hefner

great-tariff

v1.1.0

Published

A satirical NPM package that lets you apply fake tariffs to imported modules in your JavaScript project.

Readme

🇺🇸 great-tariff

"The best tariffs. Tremendous tariffs. Nobody does tariffs better than me."
– Not Actually Donald Trump

great-tariff is a satirical NPM package that simulates tariffs on your JavaScript imports. Slow them down, block them, or just mock them — all with Trump-style commentary.

🎯 Why?

Because your imports are too free. Too wild. It's time for law and order in your node_modules.

🧰 Features

  • 🧱 Delay imports with fake tariff percentages
  • 🚫 Block certain packages (e.g. china-module, mexico-wall)
  • 🔊 Console warnings that rant like a press conference
  • 🎤 Dynamic Trump quotes tied to package names and tariffs
  • 🇺🇸 MakeImportsGreatAgain mode — because why not?
  • 📘 Works with both JavaScript and TypeScript
  • 🧪 Comprehensive test suite
  • ⚙️ Fully configurable tariff policies

📦 Installation

# Using npm
npm install great-tariff

# Using pnpm
pnpm add great-tariff

# Using yarn
yarn add great-tariff

🚀 Usage

JavaScript (CommonJS)

const { imposeTariff, setConfig } = require('great-tariff');

// Configure your tariffs
setConfig({
  policies: {
    'lodash': { tariffRate: 30, action: 'delay' },
    'axios': { tariffRate: 20, action: 'log' },
    'china-module': { action: 'block' },
  }
});

const _ = await imposeTariff('lodash');     // Adds delay
const axios = await imposeTariff('axios');  // Logs a warning

JavaScript (ESM)

import { imposeTariff, setConfig } from 'great-tariff';

// Configure your tariffs
setConfig({
  policies: {
    'lodash': { tariffRate: 30, action: 'delay' },
    'axios': { tariffRate: 20, action: 'log' },
    'china-module': { action: 'block' },
  }
});

const _ = await imposeTariff('lodash');     // Adds delay
const axios = await imposeTariff('axios');  // Logs a warning

TypeScript

import { imposeTariff, setConfig, TariffConfig } from 'great-tariff';

// Configure your tariffs
setConfig({
  policies: {
    'lodash': { tariffRate: 30, action: 'delay' },
    'axios': { tariffRate: 20, action: 'log' },
    'china-module': { action: 'block' },
  }
});

const _ = await imposeTariff('lodash');     // Adds delay
const axios = await imposeTariff('axios');  // Logs a warning

🧠 Tariff Actions

| Action | Effect | | ------- | ------------------------------------------ | | delay | Adds fake loading delay based on rate | | log | Prints a huge warning with a Trump quote | | block | Throws error and refuses to import package |

📝 Configuration

The package is fully configurable through the setConfig function. You can set different policies for different packages:

interface TariffPolicy {
  tariffRate?: number;  // Percentage for delay calculation
  action: 'block' | 'delay' | 'log';  // Action to take
}

interface TariffConfig {
  policies: Record<string, TariffPolicy>;  // Package name -> policy mapping
  mode?: string;  // Optional mode string
}

// Example configuration
setConfig({
  policies: {
    'lodash': { tariffRate: 30, action: 'delay' },
    'axios': { tariffRate: 20, action: 'log' },
    'china-module': { action: 'block' },
    'react': { tariffRate: 45, action: 'delay' },
  },
  mode: 'MakeImportsGreatAgain'
});

📚 Examples

Check out the examples directory for complete working examples in both ESM and CommonJS:

# Build the package first
npm run build

# Run ESM example
node examples/esm/index.mjs

# Run CommonJS example
node examples/commonjs/index.cjs

🧪 Testing

The package includes a comprehensive test suite. Run tests with:

# Using npm
npm test

# Using pnpm
pnpm test

# Using yarn
yarn test

Tests cover:

  • Quote generation for different actions
  • Tariff imposition timing
  • Error handling
  • Console output
  • Module resolution
  • Configuration system

🤡 Disclaimer

This package is purely a parody — it doesn't reflect real-world politics or actual economic policy. Don't use it in production unless your app is built on memes.

📜 License

MIT — Make Imports Trumpish Again