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

hwplib-js

v0.1.0

Published

Isomorphic TypeScript library to read and write HWP (Hangul Word Processor) files — a faithful port of hwplib 1.1.10

Readme

hwplib-js

Isomorphic TypeScript engine for reading and writing HWP (Hangul Word Processor, .hwp v5) files. One pure-JS codebase, no native addons — runs unchanged in the browser, Electron, and Node. Uint8Array in, Uint8Array out.

This is a JavaScript/TypeScript port of hwplib by neolord0 — a faithful, structure-preserving port of hwplib 1.1.10 (Apache-2.0). The object model, reader, writer, and BlankFileMaker are ported 1:1 from the original Java. Where the original bundles Apache POI for the OLE2/CFB container and DEFLATE, this port delegates those to cfb and fflate. See NOTICE for full attribution.

Install

npm install hwplib-js

Usage

import { HWPReader, HWPWriter, BlankFileMaker } from "hwplib-js";

const file = HWPReader.fromBytes(bytes);      // parse a .hwp (Uint8Array)
const text = file
  .getBodyText()
  .getSectionList()[0]
  .getParagraphs()
  .map((p) => p.getNormalString() ?? "")
  .join("\n");

const out = HWPWriter.toBytes(file);          // serialize back to .hwp bytes
const blank = BlankFileMaker.make();          // a valid empty document

// Deep imports mirror the original Java package path:
import { Alignment } from "hwplib-js/object/docinfo/parashape/Alignment";

The engine speaks only Uint8Array — it never touches fs, File, or the DOM, so the same build runs everywhere. Environment-specific concerns (file pickers, fs, HTML) belong in thin adapters at the edges of your app.

Status

Ported and validated against Java hwplib: reads and writes real .hwp files with golden round-trip fidelity, and builds documents from scratch via BlankFileMaker. The public test suite here exercises the binary primitives, object model, CFB container, and a self-generated read → write → re-read round-trip.

Development

npm install
npm run build       # tsc (structure-preserving) + esbuild minify → dist/
npm run typecheck
npm test            # vitest

The production build compiles with tsc preserving the directory structure (so the hwplib-js/* subpath exports keep resolving) and then minifies each emitted file in place.

Relationship to hwplib

hwplib-js tracks the public hwplib object model closely so that behavior and file compatibility match the reference implementation. It is an independent port maintained separately from the upstream Java project; issues and PRs about the port belong here, not upstream.

License

Apache-2.0 — as a derivative work of hwplib (Apache-2.0). See NOTICE.