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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@ooxml-tools/validate

v0.3.0

Published

Validate Office Open XML files in nodejs the browser

Readme

Validate Office Open XML files in nodejs the browser

Install

npm install @ooxml-tools/validate --save

CLI

Once installed run

ooxml-validate ./test.docx

All the options can be seen with

ooxml-validate --help
# ooxml-validate <filepath>
#
# validate docx files
#
# Positionals:
#   filepath  filepath of OOXML file                                      [string]
#
# Options:
#       --help                  Show help                                [boolean]
#       --version               Show version number                      [boolean]
#       --office-version, --ov  office version used for validation
#              [choices: "Microsoft365", "Office2007", "Office2010", "Office2013",
#              "Office2016", "Office2019", "Office2021"] [default: "Microsoft365"]
#       --output-format, --of   format of output
#                                  [choices: "pretty", "json"] [default: "pretty"]
#   -f, --format                document format (should be auto-detected)
#                                                [choices: "xlsx", "pptx", "docx"]

Usage

Pass an ArrayBuffer as input and get results as output

import validate from "@ooxml-tools/validate";

const version = "Microsoft365";
const results = await validate(input, version);
console.log(results);

Where version of one of ["Microsoft365", "Office2007", "Office2010", "Office2013", "Office2016", "Office2019", "Office2021"]

Development

[!NOTE]
If you don't feel like installing all the dependencies you can run the following

./docker.sh

This will start a docker shell with all the dependencies installed. The following commands can then be run in that shell without installing any dependencies (other then docker/docker-compose)

You'll need dotnet 8 installed locally, to whether it's installed run dotnet --version.

You'll also need to install the node_modules via

npm install

Build the library run

npm run build

The built npm package will be output to ./dist/npm/*

ls -l ./dist/npm/
# total 41340
# -rw-r--r-- 1 root root      818 Jul 20 09:05 _virtual_module-D7pcKkEN.js
# -rw-r--r-- 1 root root     2335 Jul 20 09:05 _virtual_process-CKiOJcMv.js
# drwxr-xr-x 3 root root       96 Jul 20 09:05 bin
# -rw-r--r-- 1 root root    35982 Jul 20 09:05 dotnet-CjdMQPqM.js
# -rw-r--r-- 1 root root   149565 Jul 20 09:05 dotnet.native.8.0.7.lb1gfjpp0m-Dp0tYBIl.js
# -rw-r--r-- 1 root root   222989 Jul 20 09:05 dotnet.runtime.8.0.7.bxd2x47e2z-B0R9BXGJ.js
# -rw-r--r-- 1 root root 41906074 Jul 20 09:05 index.js
# -rw-r--r-- 1 root root     1027 Jul 20 09:05 package.json

Known issues

It comes with some known issues

  • The library is huge, and slow. It's currently base64 encoding the WASM because of the issues getting WASM building across bundlers (help wanted)
  • ~~The library base64 encodes the input OOXML file, which is slow. We should be using streaming (help wanted)~~
  • The C# is probably very poor quality... I'm not a C# developer (help wanted)

Licence

MIT