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

@trevixal/extension-export

v1.0.5

Published

Import and export for the Trevixal editor: DOCX and RTF writers, a dependency-free DOCX reader, and file download helpers.

Readme

@trevixal/extension-export

CI npm types license

Documentation · Live editor · Changelog · Issues

The Trevixal editor

Features

  • DOCX and RTF writers, and a dependency-free DOCX reader
  • Exports carry the theme, code colours and diagrams the editor showed
  • File download helpers that work in the browser and in Node
  • 18.8 kB minified and gzipped, with TypeScript types in the package

Word and Rich Text, out and in, with its own ZIP, XML, OOXML and RTF implementations and no dependencies at all.

npm install @trevixal/extension-export

Usage

import { serializeToDOCX, serializeToRTF, parseDOCX } from '@trevixal/extension-export'

const docx = await serializeToDOCX(editor.state.doc, { title: 'Report' })
const rtf = serializeToRTF(editor.state.doc)
const doc = await parseDOCX(editor.schema, file, { images: 'embed' })

Or as descriptors that plug into @trevixal/ui's save and open plumbing:

import { exportFormats, importFormats } from '@trevixal/extension-export'
import { exportDocument } from '@trevixal/ui'

await exportDocument(editor, { exporters: [...builtinExporters(), ...exportFormats()] })

It carries what the editor was showing

Both writers take a theme and a rendered bundle from ExportContext, so a download is not a bleached copy of the document:

  • Colour. DOCX writes w:background, and the word/settings.xml that makes Word actually draw it, which is stored and ignored without. RTF shades every paragraph and restates the ink after each \\plain, because \\pard\\plain resets the colour and a theme set once at the top would last one paragraph.
  • Highlighted code. Syntax highlighting is a decoration layer, so a writer walking the model sees one plain string. @trevixal/ui captures the drawn runs and passes them here as coloured runs.
  • Diagrams. A diagram preview is an element the renderer appends, not a node. It is rasterised and embedded, which meant giving RTF pictures at all (\\pict\\pngblip), so ordinary images now embed there too instead of degrading to [alt]. The drawing replaces the source it was drawn from, unless nothing managed to draw one.

Also exported

The pieces are public, because they were written here and are useful on their own: createZip / readZip / crc32, parseXML / escapeXML, downloadFile, suggestFileName, readFileText, readFileBytes, and documentPalette for turning theme tokens into an Office palette.

License

Apache-2.0