{"id":25802421,"url":"https://github.com/appliedengdesign/gcode-reference","last_synced_at":"2025-08-01T07:43:49.970Z","repository":{"id":41256658,"uuid":"347508343","full_name":"appliedengdesign/gcode-reference","owner":"appliedengdesign","description":"Node module to provide descriptions and reference to CNC G-Codes","archived":false,"fork":false,"pushed_at":"2023-03-06T08:03:16.000Z","size":711,"stargazers_count":15,"open_issues_count":15,"forks_count":8,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-25T22:42:37.054Z","etag":null,"topics":["cnc","gcode","lathe","mill","milling","node","nodejs","reference","turning","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/appliedengdesign.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["appliedengdesign"],"custom":["http://appliedengdesign.com","https://youtube.com/c/AppliedEngDesignUSA"]}},"created_at":"2021-03-14T00:15:43.000Z","updated_at":"2024-10-15T19:33:37.000Z","dependencies_parsed_at":"2024-10-20T16:34:30.995Z","dependency_job_id":null,"html_url":"https://github.com/appliedengdesign/gcode-reference","commit_stats":{"total_commits":217,"total_committers":3,"mean_commits":72.33333333333333,"dds":0.1981566820276498,"last_synced_commit":"4a1a9066c48aff12752dca00c0665524b8ac2e8a"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appliedengdesign%2Fgcode-reference","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appliedengdesign%2Fgcode-reference/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appliedengdesign%2Fgcode-reference/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appliedengdesign%2Fgcode-reference/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appliedengdesign","download_url":"https://codeload.github.com/appliedengdesign/gcode-reference/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241037502,"owners_count":19898342,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cnc","gcode","lathe","mill","milling","node","nodejs","reference","turning","typescript"],"created_at":"2025-02-27T16:59:55.849Z","updated_at":"2025-02-27T16:59:56.552Z","avatar_url":"https://github.com/appliedengdesign.png","language":"TypeScript","funding_links":["https://github.com/sponsors/appliedengdesign","http://appliedengdesign.com","https://youtube.com/c/AppliedEngDesignUSA"],"categories":[],"sub_categories":[],"readme":"[![NPM Version](https://badgen.net/npm/v/@appliedengdesign/gcode-reference)](https://www.npmjs.com/package/@appliedengdesign/gcode-reference) [![NPM DL](https://badgen.net/npm/dt/@appliedengdesign/gcode-reference)](https://www.npmjs.com/package/@appliedengdesign/gcode-reference) [![GitHub Issues](https://badgen.net/github/open-issues/appliedengdesign/gcode-reference)](https://github.com/appliedengdesign/gcode-reference/issues)\n[![Github Stars](https://badgen.net/github/stars/appliedengdesign/gcode-reference)](https://github.com/appliedengdesign/gcode-reference) [![MIT License](https://badgen.net/badge/license/MIT)](https://opensource.org/licenses/MIT)\n\n[![CodeQL](https://github.com/appliedengdesign/gcode-reference/actions/workflows/codeql.yml/badge.svg)](https://github.com/appliedengdesign/gcode-reference/actions/workflows/codeql.yml) [![Node.js CI](https://github.com/appliedengdesign/gcode-reference/actions/workflows/nodejs-ci.yml/badge.svg)](https://github.com/appliedengdesign/gcode-reference/actions/workflows/nodejs-ci.yml)\n\n[![Follow @appliedengdesign](https://badgen.net/twitter/follow/appliedengdes)](https://twitter.com/appliedengdes)\n\n# G-Code Reference\n\nThis project aims to provide a JSON-backed reference to the G \u0026 M codes associated with CNC mills, lathes, 3D printers and more. This project was created to be consumed by our [VSCode G-Code Syntax](https://github.com/appliedengdesign/vscode-gcode-syntax) extension for hover information, but we think it can be of use for many different applications.\n\n## Goals\n\nSince this is still in very early stages of development, here are the goals outlined for the project:\n\n- JSON Files\n  - Provide a comprehensive \u0026 accurate source of information on G \u0026 M codes for CNC Mills \u0026 Lathes, as well as 3D Printers.\n- Provide an API to be consumed by Typescript / Javascript / Node applications to retrieve the information.\n- Ability to generate full pages of information in HTML or Markdown.\n- Act as a single reseource via GitHub pages for all to read the documentation\n- Provide a simple interface for contributors to add / modify the reference JSON.\n\n## Install\n\nTo install the latest version:\n\n`npm install @appliedengdesign/gcode-reference` --save\n\n## Usage\n\nTry it in the [Node.js REPL](https://npm.runkit.com/%40appliedengdesign%2Fgcode-reference) :)\n\nJavascript:\n\n```javascript\n// Import Everything ESM/Typescript style\nimport * as GRef from 'gcode-reference';\n// OR\nconst GRef = require('gcode-reference');\n\nconst gref = new GReference();\n// OR\n// initialize with a machine type\nconst gref = new GReference('mill');\n// OR\n// initalize with a machine type and variant\nconst gref = new GReference('mill', 'mazak');\n\n// Get Complete G-Code Object\nconst gcode = gref.get('G1');\n\n// Get All Codes\nconst gcode = gref.getAllCodes(CodeTypes.G);\n\n// Get Short Description\nconst shortDesc = gref.getShortDesc('G1');\n\n// Get Full Description\nconst desc = gref.getDesc('G1');\n\n// Get Current Machine Type\nconst type = gref.getType();\n\n// Set Machine Type (Will rebuild reference)\ngref.setType(GRef.MachineTypes.Mill);\n\n// Set or Remove a Variant\ngref.setVariant(Gref.MachineTypes.Mazak);\ngref.removeVariant();\n\n// Check if there is a variant\ngref.isVariant();\n\n// Get Parameters for a G/M Code\ngref.getParams('G84');\n\n// MARKDOWN GENERATION\n\n// Get Code as Markdown\nconst codeMarkdown = gref.getCodeAsMarkdown('G1');\n\n// Get All Codes formatted in Markdown\nconst codesMarkdown = gref.getAllCodesAsMarkdown('gcode');\n\n// HTML GENERATION\n\n// Get Code as HTML (complete w/ head/meta)\nconst codeHTML = gref.getCodeAsHTML('G1', false);\n\n// Get Code as HTML (partial) - default if true/false not included\nconst codeHTML = gref.getCodeAsHTML('G1');\n\n// Get All Codes as HTML (partial by default as well)\nconst codeHTML = gref.getAllCodesAsHTML('G1', false);\n\n// You can also import the types separately / individually when using Typescript\nimport {\n  Categories,\n  Category,\n  CNCCodes,\n  Code,\n  CodeType,\n  CodeTypes,\n  ICode,\n  MachineType,\n  MachineTypes,\n  Parameters,\n  Variant,\n  Variants,\n} from 'gcode-reference';\n```\n\n### Machine Types\n\nSupported machine types are `edm`, `mill`, `lathe`, `laser`, `printer` or `swiss`. You can select the machine type using the string variant or use the enum `MachineTypes`.\n\n### Variants\n\nThe current supported variants are `amada`, `brother`, `centroid`, `citizen`, `doosan`, `fadal`, `fanuc`, `haas`, `hurco`, `mach3`, `mazak`, `milltrs`, `mitsu`, `okuma`, `snpmaker` and `tormach`. These are also exposed under the enum `Variants`.\n\nFor more information on creating more variants or requesting them, please check out our [Contributing](CONTRIBUTING.md) page.\n\n## Schema\n\nThe schema used for the JSON data is published in the repo [cnccodes-json-schema](https://github.com/appliedengdesign/cnccodes-json-schema) and was created specifically for this project.\n\n## Issues\n\nIf you find any bugs or issues with the package, please create a [new GitHub issue](https://github.com/appliedengdesign/gcode-reference/issues).\n\n## Contributing\n\n### We Need Your Help\n\nWe need people to help add more G \u0026 M codes to the various machine tool bases as well as adding variants.\n\nFor information on contributing, please refer to the [CONTRIBUTING](https://github.com/appliedengdesign/gcode-reference/blob/master/CONTRIBUTING.md) doc for information on how to add to this project.\n\n### Contributors\n\n- Mike Centola ([@mikecentola](https://github.com/mikecentola)) - [contributions](https://github.com/appliedengdesign/gcode-reference/commits?author=mikecentola)\n- Tyeth Gundry ([@tyeth](https://github.com/tyeth)) - [contributions](https://github.com/appliedengdesign/gcode-reference/commits?author=tyeth)\n\n## About Applied Eng \u0026 Design\n\nWe 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!\n\nFollow us on [Twitter](https://twitter.com/appliedengdes) \u0026 [Instagram](https://instagram.com/appliedengdes), and like our [Facebook Page](https://facebook.com/appliedengdesign)!\n\n## License\n\nThis extension is licensed under the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappliedengdesign%2Fgcode-reference","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappliedengdesign%2Fgcode-reference","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappliedengdesign%2Fgcode-reference/lists"}