![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
This package contains a statemachine based parser to parse GCode in node or (possibly) in the browser.
It's fairly rough around the edges at the moment. No support for parameters
Should be fairly straightforward to use. Require require parser.js:
var gcode = require("./parser.js")
Afterwards, instantiate the parser, with a callback (see below) and optional configuration:
var parser = new gcode.GCode(cb, cfg)
Call parse
on any data / chunks of data you receive. Typically (see
config, below) parse
will emit data for each event to the callback adn
return true
or terminate processing, returning false
after an error
is encountered and error data is emitted.
... get data from somewhere ...
if (!parser.parse(data)) {
.. quit parsing ...
}
The callback you pass to the GCode
constructor will receive data
describing one of the following events:
Data passed to the callback is a hash an will always contain the following parameters:
gcode.Events.BLOCK_START
, ...BLOCK_END
, (...)N
words.ERROR events also have the following parameters: msg
the error message
and state
which is the internal state of the parser and is only useful
for debugging, this will likely be omitted in the future.
WORD events have the following additional parameters: code
the letter
part of the word and value
the value part. Unless you configure the
parser to do otherwise, it will also contain a desc
parameter with a
humanreadable describtion of the command.
COMMENT contains a parameter called comment
containing the text of the
comment, stripped of comment delimiters.
The optinal cfg
parameter that may be passed to the constructor is a
hash which may currently contain two configuration options:
false
from parse
after an error has
been emitted, instead, try to recover (this may void your warranty)desc
parameter to word events.This will be part of a JS based CNC control for the Anykey[1] /Anycnc[2]
Write a proper example driver for anycnc ... Package nicely for npm.
MIT
README.md : this file anycnc.js : example drive, extremly wip test : test fixtures make_json_fixtures.js : pre-parse fixture data for test parser.js : the actual parser test_gcode.js : run tests.
[1] http://www.anykey0x.de [2] http://blog.anykey0x.de/?p=60
FAQs
a module for processing gcode
We found that gcodejs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.