{"_id":"3d-printer-controller","_rev":"4-b9bf43e39328f0c5b1dc844e8077ecd2","name":"3d-printer-controller","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"3d-printer-controller","version":"1.0.0","description":"Control your 3D printer directly from nodeJS","main":"index.js","scripts":{"compile":"tsc --watch --declaration","start":"ts-node index.ts","test":"echo \"Error: no test specified\" && exit 1"},"keywords":["gcode","3d","printer","3d printer","serial port"],"author":{"name":"Ambrus Tóth"},"license":"ISC","devDependencies":{"@types/serialport":"^8.0.0","ts-node":"^8.8.2","tslint":"^6.1.1","typescript":"^3.8.3"},"dependencies":{"@serialport/parser-readline":"^8.0.6","rxjs":"^6.5.5","rxjs-compat":"^6.5.5","serialport":"^8.0.7"},"types":"index.d.ts","_id":"3d-printer-controller@1.0.0","_nodeVersion":"12.13.1","_npmVersion":"6.14.3","dist":{"integrity":"sha512-wnEtE7av6WKJmxQrp+fYOPE5Hkmd8clrc+fU74Jb2LydEqK9mkisGf9yNWvIL1vUUAXmduadJcjJr+MF433fxA==","shasum":"f9a4e427b4b8c74394c300e728dff17e3d07d18c","tarball":"https://registry.npmjs.org/3d-printer-controller/-/3d-printer-controller-1.0.0.tgz","fileCount":16,"unpackedSize":46189,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemCklCRA9TVsSAnZWagAAso0QAIJ9zZ3rSLDiOXlgRemo\nD4zBJfbMaiiVVuNGJ8m+OOYlYYhNZw+7nLe0FfliBRtSiVpY1QUzjsMLwVzK\n14xF/K/KnBzXkgcuLJa3VNqZ+3U4N5q2GQtDH9sbWN5PVBT1aBTODzS0GZUZ\nBQ1kiFp+/2yOTB80aKLvgkWoy/EhORCEoc6LY91aJ4BNDGC0NMwoDfxiMNaH\nFgVHEfPpR9P4+bBLKxaoIKxxuYy0v1zhwWCV6AjzmtCMr2mXU4o+7E3fFz1W\nvfKOWUGIFxUrYPN8u1xh4wuuF2KlKqFHp4S5KdfEzJR7ZK612xfwRz+DJDQR\nPKjnSE9jUEYB2aPLl/TwiMJ+tAuQDpSnBGXHu6NwZvSjqlCgzdgJr0SCIK1t\nWbT1ivFdSlhluRGKCqZRCpGvvxLSCKqW6YchX3mA1TUi6iEGHY99ZGj/Mms9\nkS0id+Ypuu93b4/YA2V0s8S+brb6p7QluNbjfffYMPyoW5I9zVi7TKBT0Jr/\nDg0+uJ7PF0gIQqKYCtztEX1zCSu1z3PnLmhu4FV1tEy7mavy9DuUvAqwzwtz\nAUaPt9YVa1Zp102LxhyrNmPjiTP735MY7Xy3fRaFsi+OJu6IwNUFOpzJ6wBw\npGEHTbvlEdwAEp4hIudKkaFWE4x7yodaDYSbbbUN7dJm/1Gn4Ex+tEKhe8sk\nQ93d\r\n=wm/0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDC8IbQoyXi0MwvZn+5r7W/C7tALcovv1C3sXj31iGzlAiEA0snopcFCLtOn19czmJLeaqJCD49P0eGAoQZOGEwqkT4="}]},"maintainers":[{"name":"processeus","email":"ambrus@johetajava.hu"}],"_npmUser":{"name":"processeus","email":"ambrus@johetajava.hu"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/3d-printer-controller_1.0.0_1587030308863_0.245956095469398"},"_hasShrinkwrap":false},"1.0.1":{"name":"3d-printer-controller","version":"1.0.1","description":"Control your 3D printer directly from nodeJS","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"start":"ts-node index.ts","serve":"tsc-watch --outDir ./dist --declaration","test":"echo \"Error: no test specified\" && exit 1"},"keywords":["gcode","3d","printer","3d printer","serial port"],"author":{"name":"Ambrus Tóth"},"license":"ISC","devDependencies":{"@types/serialport":"^8.0.0","ts-node":"^8.8.2","tslint":"^6.1.1","typescript":"^3.8.3","tsc-watch":"^4.2.3"},"dependencies":{"@serialport/parser-readline":"^8.0.6","rxjs":"^6.5.5","rxjs-compat":"^6.5.5","serialport":"^8.0.7"},"_id":"3d-printer-controller@1.0.1","_nodeVersion":"12.13.1","_npmVersion":"6.14.3","dist":{"integrity":"sha512-6GFS/tHepYufhdTugt7mxrKOSs3YbqiRrXXxqtvG/7cvUAaMzMzO4rqzaajJsCojREuKsxMG8VWJXQ2iu+LGuw==","shasum":"9ac8df626630a40e21d8dddd6ebc15a575850bc3","tarball":"https://registry.npmjs.org/3d-printer-controller/-/3d-printer-controller-1.0.1.tgz","fileCount":16,"unpackedSize":46346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemCtkCRA9TVsSAnZWagAAx7YP/RyFdX66/RxnvZyxUxXz\nRDhm1vi/0H28nE9yBLFWvZlL6TvNDoHOT0lxJGInco3FpdDlausUY06UVZlQ\n0z/8CfZqychNZSiUtn18A0XtgXNhwGe6VZ4saea2MxgR6zivLRUfNoRd0FdM\nH2KHUupaNl30suUkzJ5xf8/2IzKrvJRefQlLyu8Ams56CxwPHtIBUdOTU4Va\nqU4vXjMOzRxpd8iUZy6DGsZLXWSDo7T0KEr6SdsUZQ7B4z/2gPY1S9W/yG1N\n+ND23yvcIsmQKeaGN9TyVP3nlyfqeuNcntYlVoZtSWI6mNjA5lAHBOBnF+4Y\njibRhUhz1ZGRych4RP0B1SnzRkYI4Mb65m2n/q1LHdN+3Qxeb/o72TFKAy5P\nYMsuaOI3LLVDzNzjNaXb0KYIcbQuN4VREuIzlo+PLiYPqvp30K9+jco37nM8\n/SLi3AWlGZLRnfjExFRJW6O9B1M2VWgZBKkD+NOaoabl8l5mG//PLRSBEbo5\nTt73KRpoKgIq6b0c9RgfxU88YmDhrPIn1zJ/ptLPREY+zCvAAglLHJLjLTo2\nrvWItP1/te6SRsyr3qBYce78vsw4mtnYArJwqnZo4ePbbwEP06u/iRYsB2D5\nm6n0/6dfb1L5i6CmsHiyAg6ORYjCQQQFq0kyOl0iywwDEcfslNN2x0X1Zh6m\nop93\r\n=DLmJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC/tmVl+Z/LsVZZFI1T/JnnPm8NORbyWP2m48p4/Tp5PAiEAwj6n030NVI6gjJe/t0PPL9TsvX3C8zrFLZbMoXrcTU4="}]},"maintainers":[{"name":"processeus","email":"ambrus@johetajava.hu"}],"_npmUser":{"name":"processeus","email":"ambrus@johetajava.hu"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/3d-printer-controller_1.0.1_1587030884340_0.5131242703460313"},"_hasShrinkwrap":false},"1.0.2":{"name":"3d-printer-controller","version":"1.0.2","description":"Control your 3D printer directly from nodeJS","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"start":"ts-node index.ts","serve":"tsc-watch --outDir ./dist --declaration","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/tothambrus11/3d-printer-controller.git"},"keywords":["gcode","3d","printer","3d printer","serial port"],"author":{"name":"Ambrus Tóth"},"license":"ISC","devDependencies":{"@types/serialport":"^8.0.0","ts-node":"^8.8.2","tslint":"^6.1.1","typescript":"^3.8.3","tsc-watch":"^4.2.3"},"dependencies":{"@serialport/parser-readline":"^8.0.6","rxjs":"^6.5.5","rxjs-compat":"^6.5.5","serialport":"^8.0.7"},"gitHead":"fef37d03e8ba257a0c609d8b9688f73d5a2aafee","bugs":{"url":"https://github.com/tothambrus11/3d-printer-controller/issues"},"homepage":"https://github.com/tothambrus11/3d-printer-controller#readme","_id":"3d-printer-controller@1.0.2","_nodeVersion":"12.13.1","_npmVersion":"6.14.3","dist":{"integrity":"sha512-cn3095icGJPNs45eNo/+hOzP70T1YKotHM3o+o7pE4oMdruPYAG5KOvZUNsl+j+eDAapAq3Txug/gO/CvhFVUw==","shasum":"2d8f5e579daffeb2f76d217c7e9f5a225346bddc","tarball":"https://registry.npmjs.org/3d-printer-controller/-/3d-printer-controller-1.0.2.tgz","fileCount":16,"unpackedSize":37536,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemhHnCRA9TVsSAnZWagAAM4YQAIuHmwQA/tYbQgjCxxMC\nu8jbegjnJNAXeC/QDzCAGAvHjJKWe4eD5I1QH8GGvpXt+R1MyU0qnmIz9zAo\nVcsOE0i2JrOddhCW7CUhC4fOwTvgluS3d0QC5UOb2fWH0Gyu0ootO2+Tij+m\niuKbgrjiAIe2Qbuu6vWkkHBl2mQP0st8ZEczCwmGl8d725iiFwUnPDBGKI1Y\nQCxgZAJpiIjRFr106zHBpFMWT/fiCxRl5a5tERaMi7KD+YDyD5MGUOBfZb4e\nXqOvAPWOWNF47efWUMqVdinoOanagWI7dR61QCjgeAjgKsHXMamcPQSfDsy+\njmhdgccHncW23nm8MdgD2JKM7tZ2aGpXvxpLvbHWVmP3v3N2MeMh44mBBfMw\nvduyyPLbZawHtzk1xCgPeUDh5TnjFzcCAGne887L/wuUrWrk/vO3BlKsilL6\ns+NfOnq8mcCUQ73bXZB/5TkA1p3goS8v1MWMkqIbLTev1HU8cmwC5ImpA0e8\nvEB4VkKtwLyIGuK/1pkeetqE2nDxAaAEcmCl+gIRZ8LAPjU7dTNuOkvgx9rl\n+U/Fjd9KvJyXoD69yuUDhD4Vw/Cnj5GvDiM/D9c2U6HR/t1FO/tfayDDaJmO\nMz7Y0j+/2tS38hVtu1yrKKRo72veLAEl68mJLBURqZawkoy/0yUO1f/d81f2\nM2X1\r\n=ERR/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH/5FjraGdFkHSnsb/0ApmtHJN6AAC6coiqZO6Va9pYvAiBrrRkW3H0fp/pPpNhGS5ROnvnsOGc60vtxcetV1x0J3w=="}]},"maintainers":[{"name":"processeus","email":"ambrus@johetajava.hu"}],"_npmUser":{"name":"processeus","email":"ambrus@johetajava.hu"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/3d-printer-controller_1.0.2_1587155430901_0.8671010094879421"},"_hasShrinkwrap":false},"1.0.3":{"name":"3d-printer-controller","version":"1.0.3","description":"Control your 3D printer directly from nodeJS","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"start":"ts-node index.ts","serve":"tsc-watch --outDir ./dist --declaration","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/tothambrus11/3d-printer-controller.git"},"keywords":["gcode","3d","printer","3d printer","serial port"],"author":{"name":"Ambrus Tóth"},"license":"ISC","devDependencies":{"@types/serialport":"^8.0.0","ts-node":"^8.8.2","tslint":"^6.1.1","typescript":"^3.8.3","tsc-watch":"^4.2.3"},"dependencies":{"@serialport/parser-readline":"^8.0.6","rxjs":"^6.5.5","rxjs-compat":"^6.5.5","serialport":"^8.0.7"},"gitHead":"4bed53e64c868cef98bf5a85b9e158b3d2232c81","bugs":{"url":"https://github.com/tothambrus11/3d-printer-controller/issues"},"homepage":"https://github.com/tothambrus11/3d-printer-controller#readme","_id":"3d-printer-controller@1.0.3","_nodeVersion":"12.13.1","_npmVersion":"6.14.3","dist":{"integrity":"sha512-cIOPcV6b5EKHvFUoYGzXePYyzProPE3lCTZNks/pPvyG+2x/2110kTmvttqkK0sAp6WTuR/wJk3+0lDougJKhg==","shasum":"60c269ba64c9353539f47edebe5a50c4b493fc07","tarball":"https://registry.npmjs.org/3d-printer-controller/-/3d-printer-controller-1.0.3.tgz","fileCount":16,"unpackedSize":44354,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemhzyCRA9TVsSAnZWagAAjhEP/j+yiY+6QsxCEAH0VS5q\nEpckcgY6S1sT+GMnudXOBkDZkp2cAegO3NqcA18wXq8kVQfp4kUBdFbErjG+\niXkwSu5Kqy83vLgaPxGWjLCVFh5weFubs0qiNSJugvmpZsJ+yAvKrU93/Cnn\nUZroasqrFelH09jOH7fY97WbuWanx/lvfZh/vZgftBV/ouizHKr8pcVot0fT\nV7AFOAAMFp9hS3W/3hTpj1QNc2Kk8DIwN0Csr6f855fpD3mCM28c4AbMHQdD\nxTQSgVt6VkYlI06IExHwSfzwIPoqk6mqwfaLfBuQhCw2pobNCMJi3Phx/Fpq\nZOXvYUgWAIPQFJZZ3FFMBH1MYfP4CUee3mDF8srF6ArINbjBUNwK1jw9bN3A\ntDcbSGua5TJyOBeSFCBFIcbh4MC/siC7mt6yvx9oV8N63brRC2HqT6k/GMuK\nZSrew38EvI5uJH5gCn1pHPqYEBuKHtWPGOiFXU64EP63xZ5BbPQAbjqeZvZ8\nxxdDmbiG4tAfwgQ86AjY/0h+PlLhSkX8CGOEknXNujzjehBx+t+5MIy84m+C\nuLGj8WNE0n6Q8K4pXDQZ+KTGlxE7mUAK+G2Zj21MuOdf3F44wsGJ6dYmdujj\nUYJtaMs6kSHPG/glLOsQUXPoaYAOvH7JhPo5/mTa0njy1sSmNO7Irv+w1kSm\n/Tv/\r\n=HFvH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEK7oSqhY+gDk0+Tgfgaf9k/qAGeKWCkTQeDWBnFAwUQAiEAwjRuGADH/RKEVOCHA05qeS6m5FvxZ+44nnyIEINselU="}]},"maintainers":[{"name":"processeus","email":"ambrus@johetajava.hu"}],"_npmUser":{"name":"processeus","email":"ambrus@johetajava.hu"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/3d-printer-controller_1.0.3_1587158257770_0.9797858334507841"},"_hasShrinkwrap":false}},"time":{"created":"2020-04-16T09:45:08.862Z","1.0.0":"2020-04-16T09:45:09.020Z","modified":"2022-04-04T10:21:06.007Z","1.0.1":"2020-04-16T09:54:44.502Z","1.0.2":"2020-04-17T20:30:31.047Z","1.0.3":"2020-04-17T21:17:37.917Z"},"maintainers":[{"name":"processeus","email":"ambrus@johetajava.hu"}],"description":"Control your 3D printer directly from nodeJS","keywords":["gcode","3d","printer","3d printer","serial port"],"author":{"name":"Ambrus Tóth"},"license":"ISC","readme":"# 3D printer controller\r\nThis module helps you control your 3d printer from JavaScript (& TypeScript). The module uses promises, so you can wait for the motor moves to be completed.\r\n## Features \r\n - Send custom GCode to the printer\r\n - Move the nozzle to an absolute position\r\n - Move the nozzle with a relative position\r\n - Set the speed of movement in mm/s\r\n - Get current position, get target position\r\n - Auto home the nozzle on the specified axes.\r\n## Get started\r\n1. Add the module to your dependencies:\r\n    ```shell script\r\n    npm i 3d-printer-controller --save\r\n    ```\r\n2. Create a printer instance in your code and call its ```.init()``` function:\r\n   ```javascript\r\n   import {Printer} from \"3d-printer-controller\";\r\n   \r\n   (async () => {\r\n       const myPrinter = new Printer(\"COM5\", 115200, {x: 220, y: 220, z: 300});\r\n       await myPrinter.init();\r\n   })();\r\n   ```\r\n   Note, that you should provide the correct size of the printing area in case you don't want your printer be broken.\r\n   You have to write your code inside an async function if you want to use await.\r\n\r\n## API\r\n### Cosntructor\r\n```javascript\r\nnew Printer(port: string, baudRate: number, maxPrintSize: Vector3D);\r\n    // Vector3D is an object like {x: number, y: number, z: number}\r\n```\r\nExample:\r\n```javascript\r\nconst myPrinter = new Printer(\"COM5\", 115200, {x: 220, y: 220, z: 300});\r\n```\r\n### Initialise the 3D printer\r\n```javascript\r\nawait myPrinter.init();\r\n```\r\nYou must invoke this method before using the printer.\r\n\r\n### Auto home\r\n```javascript\r\nawait myPrinter.autoHome([\"X\", \"Y\", \"Z\"]);\r\n```\r\nThis auto homes the nozzle on the X, Y, and Z axes.\r\n\r\nThere is a particular function which auto homes the nozzle on the X and Y axes. \r\n```javascript\r\nawait myPrinter.autoHomeXY();\r\n```\r\n\r\n### Send GCode\r\nYou can send a GCode string, or an array of GCode strings with this function:\r\n```javascript\r\n// string:\r\nawait myPrinter.sendGCode(\"G28\");\r\n\r\n// array:\r\nawait myPrinter.sendGCode([\r\n    \"G91\",\r\n    \"G0 F4800\",\r\n    \"G0 X10 Y40\"\r\n]);\r\n``` \r\n\r\n### Set the speed of the movement\r\n```javascript\r\nawait myPrinter.setSpeed(80);\r\n```\r\nSets the speed of the movement in millimeters / second.\r\n\r\n### Go to a specified position\r\nYou can make the nozzle go to specified position in millimeters. You can specify a vector or the X, Y(optional), Z(optional) components of the vector directly:\r\n```javascript\r\nawait myPrinter.goTo({x: 30, y: 60, z: 1}); // The nozzle goes to (30; 60; 1)\r\nawait myPrinter.goTo(50, 90, 2); // The nozzle goes to (50; 90; 2).\r\nawait myPrinter.goTo(30, 50); // The z value was not specified, so it goes remains the same as in the previous movement. The new position will be (30; 50; 2).\r\n```\r\n\r\n### Get current position\r\n```javascript\r\nconst currentPos = await myPrinter.getCurrentPosition();\r\nconsole.log(currentPos); // {x: number, y: number, z: number}\r\n```\r\nReturns the current position of the nozzle. This value is changing while the nozzle moves. This will become equal to the target position as soon as the nozzle finishes its movement.\r\n### Get target position\r\n```javascript\r\nconst targetPos = await myPrinter.getTargetPosition();\r\nconsole.log(targetPos); // {x: number, y: number, z: number}\r\n```\r\nReturns the target position of the nozzle.\r\n### Get current position and target position at once\r\n```javascript\r\nconst posData = await myPrinter.getPositionData();\r\nconst currentPos = posData.currentPosition;\r\nconst targetPos = posData.targetPosition;\r\n```\r\nThis method is only for saving time when we need all the two positions in one place (for example when waiting for the nozzle to finish its movement).\r\n","readmeFilename":"README.md","homepage":"https://github.com/tothambrus11/3d-printer-controller#readme","repository":{"type":"git","url":"git+https://github.com/tothambrus11/3d-printer-controller.git"},"bugs":{"url":"https://github.com/tothambrus11/3d-printer-controller/issues"}}