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

@008h/oxs-stitch-svg

v0.4.0

Published

Render @008h/oxs cross-stitch charts as SVG (pixel, stitch and pattern looks)

Downloads

430

Readme

@008h/oxs-stitch-svg

Render @008h/oxs cross-stitch charts as SVG strings. Pure TypeScript, no DOM.

import { parseOxs } from '@008h/oxs';
import { renderSvg } from '@008h/oxs-stitch-svg';

const svg = renderSvg(parseOxs(xml), { variant: 'stitch', cellSize: 20 });

Variants

  • pixel: one filled square per stitch.
  • stitch: two slanted, elongated hexagonal threads per stitch (with edge, sheen and shadow), backstitches on top. Every number lives in THREAD_STYLE.
  • pattern: tinted cells with symbols and a grid. Pass grayscaleResolver to choose the symbol for a color.

Options

| Option | Default | Meaning | |---|---|---| | cellSize | 10 | Pixels per cell | | resolveColor | item color | (item) => hex6 \| undefined; return undefined or an invalid hex to use the item's color | | thread | THREAD_STYLE | Overrides of the thread shape, jitter, sheen and shadow numbers for the stitch variant (clamped to a valid shape) | | overThread | 'slash' | Which thread lies on top in the stitch variant | | backThread | 'cells' | How a backstitch is threaded in the stitch variant: 'cells' splits it into one thread per cell, 'whole' draws one thread from its start to its end (the ends reach backOvershoot beyond the nodes) | | pixelBackStitch | false | pixel variant only: true draws the backstitches as flat ink lines (one round-ended <line> from start to end, in the palette color, pixelLineWidth(cellSize) wide; pass a positive finite cellSize) on top of the cells | | style | — | Deprecated and ignored; STITCH_STYLE remains only for the WebGL side | | origin | detectOrigin(chart) | 0 or 1; coordinates are interpreted with @008h/oxs dialect helpers | | background | true | false leaves out the cloth-colored background rectangle, so the background is transparent |

By default the background is the cloth color (palette index 0) when present, otherwise white; pass background: false for a transparent one. Palette colors that are not bare 6-digit hex are never written into the markup.

Not rendered: part stitches, ornaments and comment boxes. Backstitches are drawn in the stitch variant, and in the pixel variant when pixelBackStitch is true. detectOrigin looks at cell stitches only, so for a chart with backstitches alone, pass origin explicitly.

Invalid numeric input (cellSize, style fields) falls back to the defaults.

backThreadPieces(style, segment, cellSize, { whole: true }) returns a single thread for the whole segment instead of one per cell. ThreadStyle.backOvershoot (default 0.04) sets how far its ends reach beyond the nodes; backMargin is used only in the default per-cell mode. backOvershoot is a new required field of ThreadStyle, so code that builds a full ThreadStyle by hand needs to add it.

@008h/oxs is a peer dependency.

Disclaimer

OXS is a file format published by Ursa Software. This project is an independent implementation and is not affiliated with or endorsed by Ursa Software.

License

MIT