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

@richardmcquiston01/house-number-generator

v0.1.2

Published

Generates SVG/DXF laser-cutter files for house number signs.

Readme

House Number Sign Generator

npm License

Generate SVG and DXF cut files for a laser-cut house number sign: one file per digit, one per name letter, and one for the backer plate. Describe the sign in a config object and get back files ready for a laser cutter, CNC, or Cricut.

Live demo — configure a sign in the browser and download the files, no code required.

Features

  • Two sign styles — house number only, or a name plus the number.
  • Three backer shapes — square, rectangle, or round, sized automatically so every glyph fits inside the margin you choose.
  • Your fonts — load any TrueType/OpenType font; glyph outlines become cut paths.
  • Hardware or adhesive assembly — for screws, a mounting hole is placed at the deepest interior point of each glyph, with matching engraving marks on the backer. Supports M3, M4, M5, #4-40, #6-32, #8-32, #10-24, and 1/4-20.
  • SVG and DXF output — physically sized (4in, 100mm), with cut and engrave geometry kept separate.
  • Typed errors, no exceptions — every fallible call returns a Result that says which stage failed and why.
  • CLI included — generate files from a JSON config without writing code.

Installation

Requires Node.js 18 or later.

npm install @richardmcquiston01/house-number-generator

Usage

import {
  createFontRegistry,
  generateSign,
} from '@richardmcquiston01/house-number-generator';
import {readFileSync, writeFileSync, mkdirSync} from 'node:fs';

const fonts = createFontRegistry();
const fontBytes = new Uint8Array(readFileSync('./fonts/DejaVuSans.ttf')).buffer;
const registered = fonts.register('digits', fontBytes);
if (!registered.ok) {
  throw new Error(`Could not load font: ${registered.error.message}`);
}

const result = generateSign({
  config: {
    style: 'numbersOnly',
    houseNumber: '742',
    font: {numberFont: 'digits'},
    shape: 'rectangle',
    numberHeight: 4, // inches
    margin: 0.5,
    unit: 'in',
    assembly: {type: 'hardware', screwSize: 'M3'},
  },
  fonts,
  format: 'both', // 'svg' | 'dxf' | 'both'
});

if (!result.ok) {
  // result.error.stage is 'validation' | 'font' | 'layout'
  throw new Error(`Sign generation failed at ${result.error.stage} stage`);
}

mkdirSync('./output', {recursive: true});
for (const file of result.value) {
  writeFileSync(`./output/${file.name}`, file.content);
}

Output files

generateSign() returns one {name, content} file per physical piece, per requested format:

| File | Piece | | -------------------------- | -------------------------------------- | | number-<i>-<digit>.<ext> | One per house number digit | | name-<i>-<letter>.<ext> | One per name letter (nameAndNumbers) | | backer.<ext> | The backer plate, with engraving marks |

<ext> is svg or dxf. Cut geometry is on a CUT layer (SVG: class="cut", black); screw-position marks are on ENGRAVE (SVG: class="engrave", blue).

Configuration

| Field | Type | Notes | | -------------- | ----------------------------------------------------- | ------------------------------------------ | | style | 'numbersOnly' \| 'nameAndNumbers' | | | houseNumber | string | Digits only | | name | string | Required for nameAndNumbers | | font | {numberFont, nameFont?} | IDs registered in the font registry | | shape | 'square' \| 'rectangle' \| 'round' | | | numberHeight | number | Glyph height; drives the overall sign size | | nameHeight | number | Defaults to numberHeight | | margin | number | Applied to every edge of the backer | | unit | 'in' \| 'mm' | | | assembly | {type: 'hardware', screwSize} \| {type: 'adhesive'} | |

Hardware assembly fails with a descriptive LayoutError if a screw hole can't fit inside a glyph's stroke (for example, a thin letter with a large screw). The message lists each offending character with the clearance available versus required; choose a smaller screw or a thicker font.

Lower-level API

generateSign() chains these, and each is exported on its own:

  • validateSignConfig(config) — field-level validation errors.
  • loadFont, createFontRegistry, getGlyphOutline, getTextOutline — font loading and glyph outlines.
  • computeSignLayout(config, numberFont, nameFont, options?) — sign geometry, with optional letterSpacing and rowGap.
  • generateSvgFiles(layout, unit) and generateDxfFiles(layout, unit) — turn a layout into files.

Command line

The package installs a house-number-generator command:

npx house-number-generator \
  --config sign.json \
  --number-font ./fonts/DejaVuSans.ttf \
  --out ./output

| Flag | Required | Description | | --------------- | -------- | ---------------------------------------- | | --config | yes | Path to the sign config JSON | | --number-font | yes | Font file for the house number | | --name-font | no | Font file for the name | | --out | yes | Output directory | | --format | no | svg, dxf, or both (default both) |

sign.json holds the config fields above, minus font (the CLI fills it in from the font flags):

{
  "style": "numbersOnly",
  "houseNumber": "742",
  "shape": "rectangle",
  "numberHeight": 4,
  "margin": 0.5,
  "unit": "in",
  "assembly": {"type": "hardware", "screwSize": "M3"}
}

Development

npm install
npm run build       # compile to dist/ (ESM + CJS + types)
npm test            # run unit tests
npm run lint        # lint with ESLint
npm run format      # format with Prettier
npm run typecheck   # type-check without emitting

Pushing a v* tag runs the publish workflow (format check, lint, typecheck, tests, build, then npm publish). See CHANGELOG.md for release history.

License

Licensed under the Apache License 2.0.

© 2026 Richard McQuiston. All rights reserved.

Buy Me a Coffee

If this app, code, or repository has helped you or someone you know, please consider donating. I appreciate any help to offset the costs of development and/or AI Credits.

Donate via Stripe, or scan:

Donate via Stripe