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

@phi-ag/rvt

v0.2.3

Published

Parse Revit file format

Readme

@phi-ag/rvt

Version Coverage Downloads Size

Parse Revit file format

Usage

pnpm add @phi-ag/rvt

Examples

Node.js / Bun

import { basicFileInfo, thumbnail } from "@phi-ag/rvt";
import { openPath } from "@phi-ag/rvt/node";

const file = await openPath("family.rfa");
const info = await basicFileInfo(file);
const image = await thumbnail(file);

console.log(info);

Deno

import { basicFileInfo, thumbnail } from "@phi-ag/rvt";
import { openPath } from "@phi-ag/rvt/deno";

using file = await openPath("family.rfa");
const info = await basicFileInfo(file.data);
const image = await thumbnail(file.data);

console.log(info);

Browser

import { basicFileInfo, openFile, thumbnail } from "@phi-ag/rvt";

// Get a file handle from <input type="file" accept=".rfa,.rvt" />
// see https://developer.mozilla.org/en-US/docs/Web/API/File_API/Using_files_from_web_applications
const selectedFile = document.getElementById("input").files[0];

const file = await openFile(selectedFile);
const info = await basicFileInfo(file);
const image = await thumbnail(file);

console.log(info);

If you don't want to throw errors, use tryOpenPath, tryOpenFile, tryBasicFileInfo and tryThumbnail

tryOpenPath("valid.rvt");
// => { ok: true; data: ... }

tryOpenPath("invalid.rvt");
// => { ok: false; error: "Error message" }

tryBasicFileInfo(validFile);
// => { ok: true; data: { version, build, ... } }

tryBasicFileInfo(invalidFile);
// => { ok: false; error: "Error message" }

Development

Install fnm or nvm (nvm-windows)

Install Node.js

fnm use

Install pnpm

corepack enable
corepack prepare --activate

Install packages

pnpm i

Watch

pnpm dev

Test

pnpm test

Reverse Engineering

The code in this repository was created through clean-room reverse engineering.

Tools

Example

  1. Pick a file you want to inspect. I'm using racbasicsamplefamily-2026.rfa for this example.
  2. Extract the Compound File Binary Format using 7z.
7z x racbasicsamplefamily-2026.rfa

.
├── BasicFileInfo
├── Contents
├── Formats
│   └── Latest
├── Global
│   ├── ContentDocuments
│   ├── DocumentIncrementTable
│   ├── ElemTable
│   ├── History
│   ├── Latest
│   └── PartitionTable
├── PartAtom
├── Partitions
│   └── 69
├── RevitPreview4.0
└── TransmissionData
  1. Recursively analyze and extract data using binwalk.
binwalk -Me Global/ElemTable

extractions/
├── ElemTable -> /home/peter/rdp/family-2026/Global/ElemTable
└── ElemTable.extracted
    └── 8
        └── decompressed.bin
  1. Use a hex editor to inspect the data.
imhex extractions/ElemTable.extracted/8/decompressed.bin
  1. Start to guess what the data could represent.
Hex View 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F

00000000 C9 05 C8 07 00 00 00 00 00 00 00 00 00 00 00 00 ................

After looking at a couple of files I'm thinking:

  • The first byte could indicate the file version, seems to be consistent for a given Revit version.
  • The second byte seems to be always 05.
  • Interpreting the next 4 bytes C8 07 00 00 as little-endian int32 is 1992.
    • I believe this is the total amount of entries in this file.
    • It seems strange that they are using int32 for this value as they moved to int64 element ids, see 64-Bit Element Ids, Maybe?
  • After the initial 6 bytes the file can be processed in 40 byte chunks (everything little-endian):
    • Id: int64
    • Unknown (1): int32
    • Unknown (2): int32
    • Unknown (3): int32
    • Id (2): int64 (seems to be always identical to the first id)
    • Unknown (4): int64
    • Unknown (5): int32

This is as far as I got for ElemTable.