
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@cratefit/pack
Advanced tools
A powerful 3D bin packing library for optimizing container, pallet, and truck loading.
npm install @cratefit/pack
For visualization support:
npm install @cratefit/pack @cratefit/viz three
import { pack, createBin, createItem } from '@cratefit/pack';
// Define a bin (container)
const bin = createBin({
id: 'bin-1',
width: 1200,
height: 1000,
depth: 800,
maxWeight: 1000,
});
// Define items to pack
const items = [
createItem({ id: 'item-1', width: 400, height: 300, depth: 200, weight: 10, quantity: 5 }),
createItem({ id: 'item-2', width: 300, height: 200, depth: 150, weight: 5, quantity: 8 }),
];
// Pack items
const result = pack({
bins: [bin],
items,
options: {
algorithm: 'auto',
},
});
console.log(`Utilization: ${(result.stats.avgUtilization * 100).toFixed(1)}%`);
console.log(`Packed: ${result.stats.packedItems}/${result.stats.totalItems} items`);
import { packPallet, PALLET_STANDARDS } from '@cratefit/pack';
const result = packPallet({
pallet: PALLET_STANDARDS.EUR1,
items: [...],
options: {
maxStackHeight: 1800,
stackingRules: true,
},
});
import { packContainer, CONTAINER_STANDARDS } from '@cratefit/pack';
const result = packContainer({
container: CONTAINER_STANDARDS['20ft'],
items: [...],
options: {
optimizeForWeight: true,
},
});
Use @cratefit/viz for 2D/3D rendering:
import { pack } from '@cratefit/pack';
import { renderTopView, create3DScene, renderPackedBin3D } from '@cratefit/viz';
// 2D Canvas
renderTopView(canvas, result.packed[0], { showLabels: true });
// 3D Three.js
const { scene, camera, renderer } = await create3DScene(container);
await renderPackedBin3D(scene, result.packed[0]);
See @cratefit/viz for more details.
pack(options) - Main packing functioncreateBin(spec) - Create a bin specificationcreateItem(spec) - Create an item specificationpackPallet(options) - Pallet-specific packingpackContainer(options) - Container-specific packingpackTruck(options) - Truck-specific packing with axle weight calculationtype Algorithm =
| 'extreme-point' // Fast, good for uniform items
| 'layer-building' // Best for stable stacking
| 'wall-building' // Good for varied sizes
| 'eb-afit' // Human-like heuristic
| 'auto'; // Automatic selection
FAQs
3D Bin Packing Library - Optimize container, pallet, and truck loading
We found that @cratefit/pack 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.