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

starlight-txt-to-pdf

v1.0.3

Published

Convert TXT files to styled PDF in Starlight

Readme

Starlight TXT to PDF

Purpose Starlight TXT to PDF converts a plain text file written in a simple DSL into a styled PDF. It supports headers, colors, bold, italic, absolute positioning, images, and automatic pagination.

Installation

npm install starlight-txt-to-pdf

Basic Usage

` import { txtToPdf } from "starlight-txt-to-pdf";

await txtToPdf("input.txt", "output.pdf", { header: "My Document Header" }); `

TXT DSL Syntax

1. Headings Use hash-style headings inside the TXT file.

# Title ## Section ### Sub Section

2. Bold Text

[b]This text is bold[/b]

3. Italic Text

[i]This text is italic[/i]

4. Colored Text

[color:red]Red Text[/color] [color:gray]Gray Text[/color] [color:blue]Blue Text[/color]

Supported colors: red, green, blue, yellow, cyan, magenta, gray, white, black

5. Absolute Positioned Text Draw text at an exact X,Y position on the page.

[pos:430,120][color:gray]— Macedon[/color][/pos]

Coordinates are in PDF points.

6. Images Embed images anywhere on the page.

[img:logo.png,x=450,y=50,w=80,h=80]

Supported formats: PNG, JPG, JPEG

Page Layout

• Automatic page breaks • Header shown on every page • Footer with page number • Margins handled internally

Header text can be customized using options.

Options

header Text shown at the top of every page.

{ header: "My Custom Header" }

Example TXT File

` # Love Letter

[color:red]My Dearest[/color]

This document was generated using Starlight.

[pos:420,100][color:gray]— Dominex Macedon[/color][/pos]

[img:logo.png,x=460,y=40,w=60,h=60] `

Output

• Clean PDF layout • Styled text • Images embedded • Multi-page support

Notes

• TXT file must exist • Image paths must be valid • Colors are predefined • Absolute positioning overrides flow layout

Developer

Developer - Dominex Macedon

https://starlight-learn-lang.pages.dev/