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

grom-font-effects

v0.1.2

Published

Browser renderer for Text Effects Editor JSON presets.

Readme

GROm Font Effects

Browser-first TypeScript renderer for Text Effects Editor JSON presets. It loads or parses an exported effect document and renders the result into an HTML canvas.

Try the editor

Download JSON effect examples from the Text Effects Editor repository. Load them with FontEffectDocument.load(url), parse them with FontEffectDocument.parse(json), or import them directly into the editor.

Text effect examples

License

GROm Font Effects is free and open-source under the MIT License. You can use, copy, modify, and distribute it for free, including in commercial projects, as long as the copyright notice and author attribution to Roman Gaikov are preserved.

Installation

Install the public package from npm:

npm install grom-font-effects

Then import from the package:

import { FontEffectDocument } from 'grom-font-effects';

Basic Usage

Parse an exported JSON document and create a transparent canvas:

const document = FontEffectDocument.parse(jsonText);
const canvas = document.createCanvas();

document.body.append(canvas);

Override text or font settings at render time:

const canvas = document.createCanvas({
  text: 'GROm Games',
  fontFamily: 'Comic Sans MS',
  fontSize: 180,
  canvasWidth: 1500,
  canvasHeight: 500,
  boldWeight: 900,
  italic: false,
});

Render into an existing canvas or 2D context:

document.drawToCanvas(existingCanvas, { text: 'PLAY' });
document.drawToCanvas(existingContext, { fontSize: 220 });

Load a JSON preset by URL:

const document = await FontEffectDocument.load('/presets/chrome.json');
const canvas = document.createCanvas();

Document Shape

The renderer accepts the same JSON exported by Text Effects Editor:

{
  "version": 1,
  "text": "Hello World",
  "fontFamily": "Arial",
  "fontSize": 180,
  "canvasWidth": 1200,
  "canvasHeight": 800,
  "boldWeight": 400,
  "italic": false,
  "effects": [
    { "type": "fill", "color": "#10161A", "opacity": 1 }
  ]
}

Missing document fields fall back to editor defaults. Unsupported or malformed effects are skipped; if nothing valid remains, a black fill effect is used.

Supported Effects

  • group: renders nested child effects into an isolated buffer.
  • fill: fills text with a solid color.
  • stroke: draws text outlines with canvas stroke settings.
  • gradientFill: fills text with evenly distributed gradient colors.
  • patternFill: fills text with procedural stripes, dots, checker, or grid patterns.
  • noise: applies procedural noise to already rendered content.
  • shadow: renders a drop shadow behind the current group buffer.
  • innerShadow: casts shadow inward from transparent pixels onto filled pixels.
  • glow: adds a colored glow behind the current group buffer.
  • blur: destructively blurs the current buffer.
  • wave: destructively sine-warps the current buffer.
  • distort: destructively distorts the current buffer with procedural displacement.
  • compositeBlend: applies a canvas composite operation to the current buffer.

API

class FontEffectDocument {
  static load(url: string): Promise<FontEffectDocument>;
  static parse(json: string | unknown): FontEffectDocument;

  readonly source: FontEffectsDocumentSnapshot;
  readonly effects: IFontEffect[];

  createCanvas(options?: RenderOptions): HTMLCanvasElement;
  drawToCanvas(
    canvas: HTMLCanvasElement | CanvasRenderingContext2D,
    options?: RenderOptions,
  ): void;
}

RenderOptions can override text, fontFamily, fontSize, canvasWidth, canvasHeight, boldWeight, and italic.

Development

npm install
npm run build

Build output is written to dist/ as an ESM browser bundle with TypeScript declarations.