# gcode-json-converter

> A tool for converting Gcode to a json object, and vice versa

Latest version **1.2.1** (published 2017-09-26) · Apache 2.0 license · 0 weekly downloads

## Install

```sh
npm install gcode-json-converter
pnpm add gcode-json-converter
yarn add gcode-json-converter
bun add gcode-json-converter
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2017-09-26 |
| First published | 2017-03-21 |
| Weekly downloads | 0 |
| License | Apache 2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=7.6 |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Maintainers | matthova |
| Keywords | gcode, json, converter |

## Links

- npm: https://www.npmjs.com/package/gcode-json-converter
- Repository: https://github.com/MachineCollaborationUtility/gcode-json-converter
- Homepage: https://github.com/MachineCollaborationUtility/gcode-json-converter#readme
- Issues: https://github.com/MachineCollaborationUtility/gcode-json-converter/issues
- npm.io page: https://npm.io/package/gcode-json-converter

## Dependencies (4)

- [lodash](https://npm.io/package/lodash.md) ^4.17.2
- [to-case](https://npm.io/package/to-case.md) ^2.0.0
- [bluebird](https://npm.io/package/bluebird.md) ^3.4.6
- [deep-equal](https://npm.io/package/deep-equal.md) ^1.0.1

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.2.1 (latest) — 2017-09-26
- 1.2.0 — 2017-08-09
- 1.1.0 — 2017-04-18
- 1.0.1 — 2017-04-18
- 1.0.0 — 2017-04-18
- 0.2.2 — 2017-03-30
- 0.2.1 — 2017-03-29
- 0.2.0 — 2017-03-29
- 0.1.0 — 2017-03-29
- 0.0.1 — 2017-03-21

## README

### GCode JSON Converter ![gcode-json-converter build status](https://travis-ci.org/MachineCollaborationUtility/gcode-json-converter.svg?branch=master)

A basic tool for converting GCode into a JSON object and GCode JSON objects back into gcode.

### Contributing
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for [contributions](./CONTRIBUTING.md).


``` js
const gcodeToObject = require('gcode-json-converter').gcodeToObject;
const objectToGcode = require('gcode-json-converter').objectToGcode;

// Convert a line of gcode into an object
const g1Result = gcodeToObject('G1 X -0.1; soooo cool');
const objectResult = {
  command: 'G1',
  args: {
    x: -0.1,
  },
  comment: ' soooo cool',
};

// Convert a gcode object back into a line of gcode
const backToGcode = objectToGcode(g1Result);
const stringResult = 'G1 X-0.1; so cooool'

```

---
_Source: https://npm.io/package/gcode-json-converter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
