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

poster-design-utils

v1.0.0

Published

A collection of utility functions for poster and graphic design calculations

Readme

poster-design-utils

A collection of utility functions for poster and graphic design calculations.

Create stunning AI-powered posters at poster.sh

Installation

npm install poster-design-utils

Features

  • Paper size constants (ISO A-series, US sizes, social media dimensions)
  • Unit conversions (mm, inches, pixels)
  • Color conversions (HEX, RGB, CMYK)
  • DPI calculations for print and web
  • Aspect ratio calculations
  • File size estimation

Usage

const posterUtils = require('poster-design-utils');

// Get poster dimensions in pixels
const a3Poster = posterUtils.getPosterDimensions('a3', 300, 'portrait');
console.log(a3Poster);
// { width: 3508, height: 4961, name: 'A3', orientation: 'portrait' }

// Get Instagram story dimensions
const story = posterUtils.getPosterDimensions('instagram_story');
console.log(story);
// { width: 1080, height: 1920, name: 'Instagram Story', orientation: 'portrait' }

// Convert mm to pixels
const pixels = posterUtils.mmToPixels(210, 300); // A4 width at 300 DPI
console.log(pixels); // 2480

// Color conversions
const rgb = posterUtils.hexToRgb('#ff5733');
console.log(rgb); // { r: 255, g: 87, b: 51 }

const cmyk = posterUtils.rgbToCmyk(255, 87, 51);
console.log(cmyk); // { c: 0, m: 66, y: 80, k: 0 }

// Get aspect ratio
const ratio = posterUtils.getAspectRatio(1920, 1080);
console.log(ratio); // '16:9'

// Estimate file size
const fileSize = posterUtils.estimateFileSize(3508, 4961, 24, 0.1);
console.log(fileSize); // { bytes: 2088670, kb: 2040, mb: 1.99 }

Available Paper Sizes

Print Sizes (mm)

  • a0 - A0 (841 × 1189 mm)
  • a1 - A1 (594 × 841 mm)
  • a2 - A2 (420 × 594 mm)
  • a3 - A3 (297 × 420 mm)
  • a4 - A4 (210 × 297 mm)
  • a5 - A5 (148 × 210 mm)
  • a6 - A6 (105 × 148 mm)
  • letter - US Letter (216 × 279 mm)
  • legal - US Legal (216 × 356 mm)
  • tabloid - Tabloid (279 × 432 mm)

Social Media Sizes (pixels)

  • instagram_square - 1080 × 1080
  • instagram_portrait - 1080 × 1350
  • instagram_story - 1080 × 1920
  • facebook_post - 1200 × 630
  • twitter_post - 1200 × 675
  • youtube_thumbnail - 1280 × 720
  • linkedin_post - 1200 × 627

API Reference

Unit Conversion

  • mmToPixels(mm, dpi) - Convert millimeters to pixels
  • pixelsToMm(pixels, dpi) - Convert pixels to millimeters
  • inchesToPixels(inches, dpi) - Convert inches to pixels
  • pixelsToInches(pixels, dpi) - Convert pixels to inches

Poster Dimensions

  • getPosterDimensions(size, dpi, orientation) - Get dimensions for a paper size

Color Conversion

  • hexToRgb(hex) - Convert HEX to RGB
  • rgbToHex(r, g, b) - Convert RGB to HEX
  • rgbToCmyk(r, g, b) - Convert RGB to CMYK (for print)

Utilities

  • getAspectRatio(width, height) - Calculate aspect ratio
  • estimateFileSize(width, height, bitDepth, compressionRatio) - Estimate file size
  • getRecommendedDpi(useCase) - Get recommended DPI for use case

Related

  • poster.sh - AI Poster Generator
  • Create stunning posters with AI in seconds

License

MIT