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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@breakflow/core

v0.1.2

Published

Framework-independent core pagination engine, layout models, scoring, and diagnostics for BreakFlow.

Readme

@breakflow/core

Framework-independent core pagination engine, layout models, scoring, and diagnostics for BreakFlow.

NPM Version Live Demo License: MIT

🚀 Try the Live Interactive Demo (Angular 22 + Signals + client-side jsPDF showcase)


Overview

@breakflow/core is the pure, zero-DOM core engine behind BreakFlow. It operates on an abstract layout tree representation, evaluating page break candidates, computing penalty scores, and producing deterministic page plans.

Because it has zero external dependencies and no browser DOM requirement, it runs anywhere: in Node.js, Web Workers, Edge runtimes, or in browser applications.

Key Features

  • Page Geometry Calculators: Full support for standard formats (A3, A4, A5, Letter, Legal), orientations (portrait, landscape), and custom dimensions (mm, cm, in, pt, px).
  • Break Scoring Engine: Sophisticated penalty heuristics for:
    • Orphan headings (keepWithNext)
    • Component fragmentation (keepTogether / break-inside: avoid)
    • Table row slicing
    • Unbalanced whitespace / awkward page breaks
  • Table Splitting Planner: Computes non-destructive multi-page slices for tabular data with repeating header preservation.
  • Diagnostic Reporter: Emits actionable layout warnings and issue logs (orphan-heading, split-component, overflow-block, empty-page).
  • Declarative Configuration: Strongly-typed defineConfig() helper with smart default presets.

Installation

npm install @breakflow/core

Or using pnpm / yarn:

pnpm add @breakflow/core
# or
yarn add @breakflow/core

Quick Example

import { defineConfig, GreedyStrategy, calculatePageCapacity } from '@breakflow/core';

// 1. Define page geometry and rules
const config = defineConfig({
  page: {
    format: 'A4',
    margin: { top: '15mm', bottom: '15mm', left: '15mm', right: '15mm' }
  },
  smartDefaults: true,
  table: {
    repeatHeader: true,
    preventRowSplit: true
  }
});

// 2. Compute available vertical budget (px at 96 DPI)
const capacity = calculatePageCapacity(config.page);
console.log(`Usable page height: ${capacity.contentHeight}px`);

// 3. Plan pagination strategy
const strategy = new GreedyStrategy(config);
// ... pass layout tree nodes to plan pagination

Monorepo Packages


Links

License

MIT © BreakFlow Contributors