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

printing-services

v1.5.1

Published

Get book dimensions for popular printing services, such as bleed, safety margin, and spine width.

Readme

Printing Services

-> Documentation & Demo

Get book dimensions for popular printing services, such as bleed, safety margin, and spine width.

This is especially useful for generating covers which often require complex and specific measurements. Services/bindings are only included if they support bleed for at least the cover. This rules out many basic printing services, which don't require complex calculations anyway.

Unlike many other resources, these dimensions have been manually verified with official documentation from each service (i.e. no AI slop). Great care has been made to ensure everything is exact.

Install

npm install printing-services

Works in browser, Node, and other runtimes.
Only one dependency which is a tiny module for doing math in decimals for precision.

Supported services

| Service | Availability | Bindings | |---------|--------------|----------| | Kindle Direct Publishing | Global | Paperback, Hardcover | | Lulu | Global | Paperback Perfect Bound, Saddle Stitch, Coil Bound, Hardcover Case Wrap, Hardcover Linen Wrap | | ctrlPrint | Australia | Saddle Stitch, Wire Bound, Spiral Bound, Perfect Bound | | Officeworks | Australia | Premium Booklet | | VistaPrint Australia | Australia | Booklet |

(feel free to submit PRs for more, you can copy one of the existing service files to guide you)

Usage

import {get_service, list_services} from 'printing-services'

// Get services
const services = list_services('us')
const kdp = get_service('kdp')

// List available options (each accepts optional filters)
const sizes = kdp.get_sizes()
const bindings = kdp.get_binding_types()
const ink_types = kdp.get_ink_types()
const paper_types = kdp.get_paper_types()
const cover_types = kdp.get_cover_types()

// Calculate dimensions for a book
const dimensions = kdp.get_dimensions({
    size: 'us_trade',
    pages: 300,
    binding_type: 'paperback',
    paper_type: 'white',
    ink_type: 'bw',
    unit: 'inch',  // Can be 'mm'
    numbers: 'Big',  // Can be 'number' or 'string'
})

Result of get_dimensions example above

Numeric values are decimal objects (big.js) to avoid floating point imprecision in mm/inch math. Use numbers: 'number' or numbers: 'string' to get regular JS values.

const dimensions = {
    unit: 'inch',

    interior_bleed: Big('0.125'),
    interior_margin: Big('0.25'),
    interior_gutter: Big('0.25'),
    interior_safe_width: Big('5.25'),
    interior_safe_height: Big('8.5'),
    interior_trim_width: Big('6'),
    interior_trim_height: Big('9'),
    interior_total_width: Big('6.125'),
    interior_total_height: Big('9.25'),

    cover_bleed: Big('0.125'),
    cover_margin: Big('0.125'),
    cover_spine: Big('0.6756'),
    cover_spine_margin: Big('0.0625'),
    cover_face_width: Big('6'),
    cover_face_height: Big('9'),
    cover_safe_width: Big('5.75'),
    cover_safe_height: Big('8.75'),
    cover_trim_width: Big('12.6756'),
    cover_trim_height: Big('9'),
    cover_total_width: Big('12.9256'),
    cover_total_height: Big('9.25'),

    cover_region_back: {
        x: Big('0.125'),
        y: Big('0.125'),
        w: Big('6'),
        h: Big('9')
    },
    cover_region_spine: {
        x: Big('6.125'),
        y: Big('0.125'),
        w: Big('0.6756'),
        h: Big('9')
    },
    cover_region_front: {
        x: Big('6.8006'),
        y: Big('0.125'),
        w: Big('6'),
        h: Big('9')
    },
    cover_region_barcode: {
        x: Big('3.875'),
        y: Big('0.5'),
        w: Big('2'),
        h: Big('1.2')
    },

    interior_includes_cover: false,
    interior_blank_pages: 0,
    interior_has_bleed: 'outer-only',

    cover_has_bleed: true,
    cover_has_spine: true,
    cover_has_spine_text: true,
    cover_has_flaps: false
}