Narcoleptic Pony Machine

    TypeScript icon, indicating that this package has built-in type declarations

    0.0.3 • Public • Published

    GitHub Issues Github Stars CodeQL MIT License

    Follow @appliedengdesign

    G-Code Reference

    This project aims to provide a JSON-backed reference to the G & M codes associated with CNC mills, lathes, 3D printers and more. This project was created to be consumed by our [VSCode G-Code Syntax] extension for hover information, but we think it can be of use for many different applications.


    Since this is still in very early stages of development, here are the goals outlined for the project:

    • JSON Files
      • Provide a comprehensive & accurate source of information on G & M codes for CNC Mills & Lathes, as well as 3D Printers.
    • Provide an API to be consumed by Typescript / Javascript / Node applications to retrieve the information.
    • Ability to generate full pages of information in HTML or Markdown.
    • Act as a single reseource via GitHub pages for all to read the documentation
    • Provide a simple interface for contributors to add / modify the reference JSON.


    To install the latest version:

    npm install @appliedengdesign/gcode-reference


    Try it in the Node.js REPL :)


    // Import Everything ESM/Typescript style
    import * as GRef from 'gcode-reference';
    // OR
    const GRef = require('gcode-reference');
    const gref = new GReference();
    // OR
    // initialize with a machine type
    const gref = new GReference(GRef.MachineTypes.Mill);
    // Get Complete G-Code Object
    const gcode = gref.get('G1');
    // Get Short Description
    const shortDesc = gref.getShortDesc('G1');
    // Get Full Description
    const desc = gref.getDesc('G1');
    // Get Current Machine Type
    const type = gref.getType();
    // Set Machine Type (Will rebuild reference)
    // Get Parameters for a G/M Code
    // You can also import the types separately / individually
    import { GReference, MachineTypes, Categories, Parameter, Code };


    • Lathe G-Codes
    • 3D Printer G-Codes
    • Export to Markdown
    • Export to HTML


    The schema used for the JSON data is published in the repo cnccodes-json-schema and was created specifically for this project.


    If you find any bugs or issues with the package, please create a new GitHub issue.


    For information on contributing, please refer to the CONTRIBUTING doc for workflows and best practices.

    About Applied Eng & Design

    We are a full service engineering and design firm, specializing in CAD/CAM, CNC milling, rapid prototyping, training and more. We also like to dabble in Arudino / RaspberryPi projects, electronics, drones and robotics projects! Subscribe to our YouTube channel for videos on our projects, screencast tutorials, and more!

    Follow us on Twitter & Instagram, and like our Facebook Page!


    This extension is licensed under the MIT License.


    npm i @appliedengdesign/gcode-reference

    DownloadsWeekly Downloads






    Unpacked Size

    64.6 kB

    Total Files


    Last publish


    • mikecentola