{"id":25498163,"url":"https://github.com/appliedengdesign/cnccodes-json-schema","last_synced_at":"2025-04-10T05:14:14.510Z","repository":{"id":41257902,"uuid":"348423614","full_name":"appliedengdesign/cnccodes-json-schema","owner":"appliedengdesign","description":"JSON Schema for CNC G \u0026 M Codes","archived":false,"fork":false,"pushed_at":"2022-07-22T21:33:50.000Z","size":456,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T06:23:12.175Z","etag":null,"topics":["cnc","gcode","json","json-schema","reference"],"latest_commit_sha":null,"homepage":"https://appliedengdesign.github.io/cnccodes-json-schema/","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":"SECURITY.md","support":null},"funding":{"github":["appliedengdesign"],"custom":["http://appliedengdesign.com","https://youtube.com/c/AppliedEngDesignUSA"]}},"created_at":"2021-03-16T16:49:43.000Z","updated_at":"2024-07-17T23:28:42.000Z","dependencies_parsed_at":"2022-08-23T23:41:15.106Z","dependency_job_id":null,"html_url":"https://github.com/appliedengdesign/cnccodes-json-schema","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appliedengdesign%2Fcnccodes-json-schema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appliedengdesign%2Fcnccodes-json-schema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appliedengdesign%2Fcnccodes-json-schema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appliedengdesign%2Fcnccodes-json-schema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appliedengdesign","download_url":"https://codeload.github.com/appliedengdesign/cnccodes-json-schema/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247814799,"owners_count":21000643,"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","json","json-schema","reference"],"created_at":"2025-02-19T02:20:45.391Z","updated_at":"2025-04-10T05:14:14.478Z","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/cnccodes-json-schema)](https://www.npmjs.com/package/@appliedengdesign/cnccodes-json-schema) [![NPM DL](https://badgen.net/npm/dt/@appliedengdesign/cnccodes-json-schema)](https://www.npmjs.com/package/@appliedengdesign/cnccodes-json-schema) [![MIT License](https://badgen.net/badge/license/MIT)](https://opensource.org/licenses/MIT)\n\n[![Follow @appliedengdesign](https://badgen.net/twitter/follow/appliedengdes)](https://twitter.com/appliedengdes)\n\n# CNCCodes JSON Schema\n\nThis project is a schema definition for using JSON to store description and usage information about G \u0026 M codes. It was developed out of a necessity for [G-Code Reference](https://github.com/appliedengdesign/gcode-reference). It will be updated as the needs arise for the various types of G/M codes and various Machine Tools or 3D Printers.\n\nLatest NPM Version: v0.3.0\n\nLatest Draft Schema Version: 2022-07\n\nPrevious Versions: [2022-06](https://appliedengdesign.github.io/cnccodes-json-schema/draft/2022-06/schema)\n\n## Schema\n\n```json\n{\n    \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n    \"$id\": \"https://appliedengdesign.github.io/cnccodes-json-schema/draft/2022-07/schema\",\n    \"title\": \"G/M Code Dictionary\",\n    \"description\": \"JSON Schema for CNC G \u0026 M Codes\",\n    \"type\": \"object\",\n    \"required\": [\n        \"title\",\n        \"description\",\n        \"type\",\n        \"machineType\"\n    ],\n    \"properties\": {\n        \"$schema\": {\n            \"description\": \"Link to this schema\",\n            \"type\": \"string\"\n        },\n        \"title\": {\n            \"description\": \"Descriptive title of the JSON Reference\",\n            \"type\": \"string\"\n        },\n        \"description\": {\n            \"description\": \"Description of the JSON Reference\",\n            \"type\": \"string\"\n        },\n        \"keywords\": {\n            \"description\": \"An Array of string keywords describing the JSON Reference (Optional)\",\n            \"type\": \"array\",\n            \"items\": {\n                \"type\": \"string\"\n            }\n        },\n        \"type\": {\n            \"description\": \"The type of code (G or M)\",\n            \"type\": \"string\",\n            \"enum\": [\n                \"gcode\",\n                \"mcode\"\n            ]\n        },\n        \"machineType\": {\n            \"description\": \"The type of CNC machine\",\n            \"type\": \"string\",\n            \"enum\": [\n                \"edm\",\n                \"mill\",\n                \"lathe\",\n                \"laser\",\n                \"printer\",\n                \"swiss\"\n            ]\n        },\n        \"variant\": {\n            \"description\": \"Defined if G/M Codes are for specific MTB/3DP Variant. (Must be lower case, 3-8 characters)\",\n            \"type\": \"object\",\n            \"properties\": {\n                \"name\": {\n                    \"type\": \"string\",\n                    \"minLength\": 3,\n                    \"maxLength\": 8,\n                    \"pattern\": \"[a-z0-9]\"\n                },\n                \"remove\": {\n                    \"type\": \"array\",\n                    \"items\": {\n                        \"type\": \"string\"\n                    },\n                    \"uniqueItems\": true\n                }\n            }\n        },\n        \"codes\": {\n            \"description\": \"Individual G/M Codes\",\n            \"type\": \"object\",\n            \"patternProperties\": {\n                \"^G|^M\": {\n                    \"type\": \"object\",\n                    \"properties\": {\n                        \"category\": {\n                            \"description\": \"Category for the code\",\n                            \"type\": \"string\",\n                            \"enum\": [\n                                \"motion\",\n                                \"coordinate\",\n                                \"compensation\",\n                                \"canned\",\n                                \"other\",\n                                \"mcode\"\n                            ]\n                        },\n                        \"modal\": {\n                            \"description\": \"Modal / Non-Modal (boolean)\",\n                            \"type\": \"boolean\"\n                        },\n                        \"shortDesc\": {\n                            \"description\": \"A short description of the code\",\n                            \"type\": \"string\",\n                            \"minLength\": 3\n                        },\n                        \"desc\": {\n                            \"description\": \"A longer description with markdown formatting\",\n                            \"type\": \"string\",\n                            \"minLength\": 3\n                        },\n                        \"parameters\": {\n                            \"$ref\": \"#/$defs/parameters\"\n                        }\n                    },\n                    \"additionalProperties\": false,\n                    \"required\": [\n                        \"category\",\n                        \"shortDesc\"\n                    ]\n                },\n                \"additionalProperties\": false\n            },\n            \"minProperties\": 1\n        }\n    },\n    \"additionalProperties\": false,\n    \"$defs\": {\n        \"parameters\": {\n            \"description\": \"An array of possible parameters to the code\",\n            \"type\": \"object\",\n            \"patternProperties\": {\n                \"^[A-Z]{1}\": {\n                    \"type\": \"object\",\n                    \"properties\": {\n                        \"shortDesc\": {\n                            \"description\": \"A short description of the parameter\",\n                            \"type\": \"string\",\n                            \"minLength\": 3\n                        },\n                        \"desc\": {\n                            \"description\": \"A description of the parameter\",\n                            \"type\": \"string\",\n                            \"minLength\": 3\n                        },\n                        \"optional\": {\n                            \"description\": \"Parameter is required (boolean)\",\n                            \"type\": \"boolean\"\n                        }\n                    },\n                    \"required\": [\n                        \"shortDesc\",\n                        \"optional\"\n                    ],\n                    \"additionalProperties\": false\n                }\n            },\n            \"minProperties\": 1\n        }\n    }\n}\n```\n\n## Goals\n\nProvide a an accurate JSON Schema to validate JSON files containing G \u0026 M code information.\n\n## Usage\n\nUse the schema in your JSON that describes a set of G \u0026 M codes in your project (Or use our [gcode-reference](https://github.com/appliedengdesign/gcode-reference) project) by adding [https://appliedengdesign.github.io/cnccodes-json-schema/draft/2022-06/schema](https://appliedengdesign.github.io/cnccodes-json-schema/draft/2022-06/schema) to your `$schema` reference in your JSON file.\n\nAlternatively, you can install this as a package inside of your Javscript or Typescript project:\n\nInstall the latest version:\n\n`npm install @appliedengdesign/cnccodes-json-schema`\n\nReference the schema file from `node_modules`:\n\n`node_modules/@appliedengdesign/cnccodes-json-schema/dist/schema/cnccodes.schema.json`\n\nOr use directly in script applications:\n\n```javascript\n// Import the Schema\nimport { cncCodesJSONSchema } from 'cnccodes-json-schema';\n// OR\nconst cncCodesJSONSchema = require('cnccodes-json-schema');\n\n// Use schema with AJV\nconst Ajv = require('ajv').default;\nconst validate = ajv.compile(cncCodesJSONSchema);\n```\n\n## Issues\n\nIf you find any bugs or issues with the package, please create a [new GitHub issue](https://github.com/appliedengdesign/cnccodes-json-schema/issues).\n\n## Contributing\n\nFor information on contributing, please refer to the [CONTRIBUTING](https://github.com/appliedengdesign/cnccodes-json-schema/blob/master/CONTRIBUTING.md) doc for workflows and best practices.\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%2Fcnccodes-json-schema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappliedengdesign%2Fcnccodes-json-schema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappliedengdesign%2Fcnccodes-json-schema/lists"}