Import cost, measured

Know what every import costs.

The real bytes a bundler ships, not the size on disk. Then sort, clean, and budget your imports before they go out.

MIT licensed · CLI · VS Code · MCP
tinyport report · src/app.tsxshipped
import { motion } from "framer-motion"
114 kB
import moment from "moment"
72 kB
import React from "react"
2.6 kB
import { useState } from "react"
counted
import { clsx } from "clsx"
600 B
5 imports · 4 packages · 189.2 kB of 100 kB budget
The measurement problem

next/link is not 212 MB.

212 MB48.6 kB

The whole next package on disk, versus the one entry a bundler actually loads. 15.2 kB gzipped over the wire.

Sort & clean

A messy import block, put in order.

Sorted heaviest-first and grouped by origin. It shows you the change first, and writes only when you ask.

as written
import { clsx } from "clsx"
import { Button } from "./ui/Button"
import moment from "moment"
import { motion } from "framer-motion"
import { useState } from "react"
sorted by weight
import { motion } from "framer-motion"114 kB
import moment from "moment"72 kB
import { useState } from "react"2.6 kB
import { clsx } from "clsx"600 B
import { Button } from "./ui/Button"local
Three surfaces, one engine

Wherever you write imports.

01 · Command line

tinyport

Run it in CI. It fails the build the moment a file goes over its byte budget.

terminal
$ tinyport check src
src/app.tsx 189 kB over by 89 kB
exit 1 · budget exceeded
02 · VS Code

tinyport for VS Code

Every import's size shows up right in the editor, the moment you open a file.

src/app.tsx
8import { motion } from "framer-motion"114 kB
9import moment from "moment"72 kB
10import { useState } from "react"2.6 kB
03 · AI agents

@tinyport/mcp

Your coding agent can ask what a package costs before it ever adds it.

mcp
agentok to add framer-motion here?
tinyport114 kB bundled. over your 100 kB budget.
Safe by default

It will not surprise you.

Nothing changes until you say so.

Every fix is a preview first. You choose when to write.

It never deletes your code.

Unused imports are flagged, not removed. Deletion is always your call.

It won't fight your other tools.

Sort-on-save backs off when another formatter is already running.

terminal
$ tinyport fix src
would reorder 4 imports in src/app.tsx
0 files changed · nothing written

Read the docs.

CLI reference, the six MCP tools, every setting, and exactly how a size is computed.