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

hecras-parser

v0.1.1

Published

A TypeScript library for parsing HEC-RAS geometry and flow files.

Readme

HEC-RAS Parser TypeScript

A work-in-progress TypeScript library for parsing HEC-RAS geometry files (.gXX).

Currently targetting HECRAS 6.6 as of August 2025.

Installation

npm install hecras-parser

Quick Start

import { parseGeometry, loadGeometry } from "hecras-parser"

// Parse geometry file content
const geometry = parseGeometry(fileContent)

// Or load from file path (Node.js)
const geometry = await loadGeometry("./path/to/file.g01")

File Support Overview

Currently Supported File Types

| File Type | Extension | Support Level | Description | | ------------------ | -------------------- | -------------- | ------------------------------------------ | | Geometry Files | .g01, .g02, etc. | 🚧 Partial | Complete parsing and serialization support |

Not Yet Supported File Types

| File Type | Extension | Status | Description | | ----------------- | -------------------- | -------------------- | -------------------------------- | | Flow Files | .f0x, .u0x, etc. | ❌ Not Supported | Steady/unsteady flow data files | | Plan Files | .p01, .p02, etc. | ❌ Not Supported | Project plan definition files | | Project Files | .prj | ❌ Not Supported | HEC-RAS project files | | Results Files | .hdf | ❌ Out of Scope | Simulation results in HDF format |

Geometry File Parsing Support

Core Geometry Elements

| Element | Support Level | Parser | Serializer | Description | | ----------------------- | ----------------- | ------ | ---------- | ---------------------------------------------- | | File Headers | ✅ Complete | ✅ | ✅ | Title, version, viewing rectangle, description | | Storage Areas | ✅ Complete | ✅ | ✅ | 2D flow areas, elevation data, Manning's n | | Connections | ✅ Complete | ✅ | ✅ | All connection types between storage areas | | Boundary Conditions | ✅ Complete | ✅ | ✅ | Flow boundary condition lines | | Break Lines | ✅ Complete | ✅ | ✅ | Terrain modification lines | | Junctions | ✅ Complete | ✅ | ✅ | Flow junctions and splits | | Pipes | ❌Not Started | ✅ | ✅ | Flow junctions and splits | | Global Settings | ❌Partial | ✅ | ✅ | LCMann time, channel cuts, GIS settings | | River Reaches | ❌Incomplete | ❌ | ❌ | 1D river centerlines, cross-sections, stations |

Connection Types

| Connection Type | Support Level | Features Supported | | ----------------------- | --------------- | --------------------------------------------------------------- | | General Connections | ✅ Complete | Connection lines, centerline profiles, hydraulic tables | | Weir Connections | ✅ Complete | Weir coefficients, station-elevation data, ogee settings | | Bridge Connections | ✅ Complete | Bridge geometry, deck data, piers, approach sections | | Culvert Connections | ✅ Complete | All culvert shapes, barrel configurations, flow characteristics |

API Reference

Main Functions

// Parse geometry file content (string)
function parseGeometry(content: string): HECRASGeometry

// Load and parse from file path (Node.js)
function loadGeometry(filePath: string): Promise<HECRASGeometry>
function loadGeometrySync(filePath: string): HECRASGeometry

// Serialize geometry back to HEC-RAS format
function serializeGeometry(geometry: HECRASGeometry): string

Serialization

import { serializeGeometry } from "hecras-parser"

// Parse and modify geometry
const geometry = parseGeometry(content)
geometry.geomTitle = "Modified Model"

// Serialize back to HEC-RAS format
const output = serializeGeometry(geometry)
fs.writeFileSync("modified.g01", output)

Contributing

This library focuses on HEC-RAS geometry file parsing. For other file types (flow, plan, results), please open an issue to discuss implementation priorities.