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

flashforge-js

v0.6.0

Published

A NodeJS library for interacting with the Flashforge Adventurer 5M (Pro)

Readme

Flashforge JS

A small TypeScript/Node.js library for communicating with Flashforge 3D printers.

Currently focused on the Flashforge Adventurer 5M (and 5M Pro) over the built‑in TCP interface. Contributions to support more models and features are very welcome.

• NPM package name: flashforge-js • License: ISC • Status: Early alpha

Features

  • Connect to a printer by IP/hostname
  • Query printer info (name, model, firmware, serial, MAC, position)
  • Query print progress (bytes and layers, with percentages)
  • Fully typed API with Zod-backed parsing

Installation

  • npm install flashforge-js
  • or: pnpm add flashforge-js
  • or: yarn add flashforge-js

Requirements

  • Node.js 18+ recommended (uses modern Node APIs)

Quick start import { PrinterFactory } from "flashforge-js"

async function main() { // Replace with your printer's IP or a resolvable hostname const printer = await PrinterFactory.create("Adventurer 5M", { ip: "192.168.1.42" })

const info = await printer.getInfo() console.log("Printer info:", info)

const progress = await printer.getProgress() console.log("Print progress:", progress) }

main().catch((err) => { console.error(err) process.exit(1) })

API overview Top-level export

  • PrinterFactory

Creating a printer const printer = await PrinterFactory.create("Adventurer 5M", { ip: "192.168.1.42" }) // or const printer = await PrinterFactory.create("Adventurer 5M", { host: "my-printer.local" })

FlashforgePrinter interface Properties

  • id: string — identifier for the connection target (IP/host)

Methods

  • getInfo(): Promise Returns basic printer metadata and current head position.

  • getProgress(): Promise Returns current print progress by bytes and by layer, with precomputed percentages.

Types PrinterInfo

  • name: string
  • model: string
  • firmwareVersion: string
  • serialNumber: string
  • macAddress: string
  • position: { x: number; y: number; z: number }

PrinterProgress

  • bytes: { completedBytes: number; totalBytes: number; percentage: number }
  • layer: { currentLayer: number; totalLayers: number; percentage: number }

Supported printers

  • Adventurer 5M / 5M Pro (via TCP, port 8899)

Notes and limitations

  • This is an early release and the API may change.
  • Only read/query operations are provided at the moment.
  • Network communication uses a plain TCP socket and the printer’s text protocol. Ensure your printer is on the same network and allows access.
  • Timeouts and parsing errors will be surfaced as thrown errors. Wrap calls in try/catch if needed.

Error handling example try { const progress = await printer.getProgress() console.log(progress) } catch (e) { console.error("Failed to get progress:", e) }

TypeScript This library is written in TypeScript and ships its type declarations. Zod schemas validate responses from the printer and help keep the runtime data in sync with the types.

Development Prereqs

  • Node 18+
  • pnpm or npm

Scripts

  • npm run build — compile TypeScript to dist/ (also copies package.json and README.md)
  • npm run lint — format with Prettier and lint with ESLint

Project layout

  • src/index.ts — library entry point (exports PrinterFactory)
  • src/factory.ts — model factory
  • src/printer/ — core types and model-specific implementations
    • impls/ad5m/printer.ts — Adventurer 5M implementation

Roadmap

  • Add more read operations (temperatures, status, etc.)
  • Add control commands where safe and well-understood
  • Support additional Flashforge models
  • Improve connection and retry logic

Contributing Contributions are welcome! If you want to help:

  1. Open an issue to discuss your idea, printer model, or bug.
  2. Fork the repo and create a feature branch.
  3. Run linting and build locally.
  4. Include tests or example snippets when possible.
  5. Open a PR with a clear description and rationale.

Please keep changes focused and well-documented. If you have access to other Flashforge models, contributions to add and verify support are especially appreciated.

License ISC © James McNee

Acknowledgements

  • This project is community-driven and not affiliated with Flashforge. Protocol behavior and parsing are based on observed device responses.