
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
calculate-packing
Advanced tools
calculate-packing is a small TypeScript library that ships the placement / packing algorithm used by the tscircuit tool-chain for automatically laying out PCB components.
Paste PackInput and Debug Online
The solver turns a user-supplied PackInput (components, pads & strategy
settings) into a collision-free PackOutput while
minGap)networkId close togetherInternally the algorithm:
bun add calculate-packing # or npm i / yarn add
import { pack, PackInput } from "calculate-packing"
const input: PackInput = {
components: [
{
componentId: "C1",
pads: [
{
padId: "C1_1",
networkId: "GND",
type: "rect",
offset: { x: -0.6, y: 0 },
size: { x: 1.2, y: 1 },
},
{
padId: "C1_2",
networkId: "VCC",
type: "rect",
offset: { x: +0.6, y: 0 },
size: { x: 1.2, y: 1 },
},
],
},
/* …more components… */
],
minGap: 0.25,
packOrderStrategy: "largest_to_smallest",
packPlacementStrategy: "shortest_connection_along_outline",
}
const result = pack(input)
console.log(result.components) // → positioned & rotated components
See tests/ for more elaborate examples (SVG snapshots, circuit-json fixtures).
bun install # install deps
bun test # run unit & SVG snapshot tests
bunx tsc --noEmit # type-check
• lib/PackSolver – high-level packing solver
• lib/geometry – computational-geometry helpers
• lib/math – low-level math utilities
• tests/ – unit & snapshot tests
| export | purpose |
|---|---|
pack() | run the solver |
convertPackOutputToPackInput() | strip solver-only fields |
convertCircuitJsonToPackOutput() | circuit-json → PackOutput helper |
getGraphicsFromPackOutput() | build a graphics-debug scene for review |
Everything else is internal and may change without notice.
MIT – see LICENSE.
FAQs
Calculate a packing layout with support for different strategy configurations
We found that calculate-packing demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.