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

gcode-seer

v0.1.1

Published

Dependency-free TypeScript and JavaScript library for streaming 3D printer G-code analysis: motion, extrusion, temperatures and printer constraints.

Readme

G-code Seer

npm version License: MIT

G-code Seer is a dependency-free TypeScript and JavaScript library for 3D printer G-code analysis. Analyze motion, extrusion, heater targets and printer constraints from text or streaming files, with explicit diagnostics when information is incomplete.

Use it to build G-code inspection tools, check print jobs against printer profiles, or process large files without retaining the toolpath. It includes Bambu Lab and Prusa printer profiles and exports ESM with TypeScript declarations. The core performs no file or network I/O and works in Bun and modern browsers.

Install

bun add gcode-seer

The published package is available on npm.

Quick start

import { analyze } from "gcode-seer";

const report = analyze("G21\nG90\nM82\nG92 E0\nG1 X3 Y4 E1 F600", {
	initialPosition: { x: 0, y: 0, z: 0 }, // Supply only a known starting position.
});

console.log(report.distance.total); // 5 mm
console.log(report.maxAxisSpeed.x); // 6 mm/s
console.log(report.validity); // "valid"
console.log(report.complete); // true
console.log(report.diagnostics); // []

Save this as analyze.ts and run it with bun run analyze.ts. Position starts unknown unless established by the input or supplied explicitly. Output uses millimeters, seconds and Celsius.

Check printer limits

import { analyze, createPrinterProfile } from "gcode-seer";

const printer = createPrinterProfile("prusa-mk4s");
const report = analyze("M104 S291", { printer });

console.log(report.constraints); // "violated": exceeds the 290 °C hotend target limit.
console.log(report.diagnostics);

Choose a built-in profile and installed hardware from the printer catalog, or supply a custom printer profile.

Stream a file

import { analyzeStream } from "gcode-seer";

const report = await analyzeStream(Bun.file("part.gcode").stream(), {
	maxDiagnostics: 500,
});

console.log(report.distance.total);
console.log(report.complete);

analyzeStream accepts iterable or async iterable text and UTF-8 chunks. For an existing line reader, use GcodeAnalyzer.

Read metrics alongside complete and diagnostics: unsupported behavior can leave parts of a file unanalyzed. A passed constraint result applies to configured limits and modeled commands; it does not certify a print as safe. See report semantics and supported commands and limitations.

Documentation

Contributing

Bug reports, documentation improvements and pull requests are welcome. Use the Bun version pinned in .bun-version, then run bun install --frozen-lockfile and bun run check in your clone. See CONTRIBUTING.md for setup, tests and Conventional Commits, and the release guide for publishing.

Maintained by Andrew Lemons. Licensed under the MIT License.