{"_id":"d-ashesss-console","_rev":"4-b1619779b2c235b67cf88314aeedd4b1","name":"d-ashesss-console","description":"Node.js interface to linux console advanced features","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"d-ashesss-console","description":"Node.js interface to linux console advanced features","keywords":["console","terminal"],"license":"MIT","author":{"name":"Sergey Mashentsev","email":"d.ashesss@gmail.com"},"repository":{"type":"git","url":"https://github.com/d-ashesss/node-console.git"},"version":"0.1.0","main":"src/console.js","dependencies":{"sprintf-js":"^1.0"},"devDependencies":{"mocha":"^2.2","chai":"^3.0","sinon":"^1.15"},"gitHead":"072dc71d632f9084352b246676487783369368e9","bugs":{"url":"https://github.com/d-ashesss/node-console/issues"},"homepage":"https://github.com/d-ashesss/node-console","_id":"d-ashesss-console@0.1.0","scripts":{},"_shasum":"6e26675c660cf8682124adbbc0bce832e31a29d3","_from":".","_npmVersion":"2.1.2","_nodeVersion":"0.10.32","_npmUser":{"name":"d-ashesss","email":"d.ashesss@gmail.com"},"dist":{"shasum":"6e26675c660cf8682124adbbc0bce832e31a29d3","tarball":"https://registry.npmjs.org/d-ashesss-console/-/d-ashesss-console-0.1.0.tgz","integrity":"sha512-l1COiPaM+vhpkbEE0v4uW2K3XWTMW2s0hCWztmq2DBEwSYNXJcStJYUAbK9QAkh833j2vkAupBqtVjbvz8jlGQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICYeOnn30te8b22sKO9vVebQC4UgqrEYyVg0myDOpjToAiEAuLsDc33Ccl1Wr7dBCLCDJVxNpfvUl4M+RoI3/9gHcuQ="}]},"maintainers":[{"name":"d-ashesss","email":"d.ashesss@gmail.com"}],"directories":{}}},"readme":"# Console\nProvides interface to linux console advanced features.\n\n## Install via npm\n```bash\nnpm install d-ashesss-console\n```\n\n## Demo\nTo watch a demonstration run `bin/demo`\n\n## Usage\n### Console\n```js\nrequire(\"d-ashesss-console\");\n```\n\nPackage will include its features into global console object.\n\n**Console::reset()** - Resets the terminal to initial state\n```js\nconsole.reset;\n```\n\n**Console::write()** - Writes to stdout without trailing newline\n```js\nconsole.write(\"Hello World!\");\n```\n\n### Cursor\n```js\nconsole.write(\"OOOOO\\nOOOOO\\nOOOOO\\n\");\n```\n\n**Cursor::moveUp()** - Moves cursor N lines up\n```js\nconsole.cursor.moveUp(3);\nconsole.write(\"X\");\n```\n```\nXOOOO\nOOOOO\nOOOOO\n```\n\n**Cursor::moveDown()** - Moves cursor N lines down\n```js\nconsole.cursor.moveDown(2);\nconsole.write(\"X\");\n```\n```\nxOOOO\nOOOOO\nOXOOO\n```\n\n**Cursor::moveRight()** - Moves cursor N characters right\n```js\nconsole.cursor.moveRight(2);\nconsole.write(\"X\");\n```\n```\nxOOOO\nOOOOO\nOxOOX\n```\n\n**Cursor::moveLeft()** - Moves cursor N characters left\n```js\nconsole.cursor.moveLeft(2);\nconsole.write(\"X\");\n```\n```\nxOOOO\nOOOOO\nOxOXx\n```\n\n**Cursor::move()** - Moves cursor by X:Y\n```js\nconsole.cursor.move(-3, -1);\nconsole.write(\"X\");\n```\n```\nxOOOO\nOXOOO\nOxOxx\n```\n\n**Cursor::moveTo()** - Moves cursor to X:Y position on screen\n```js\nconsole.cursor.moveTo(3, 0);\nconsole.write(\"X\");\n```\n```\nxOOXO\nOxOOO\nOxOxx\n```\n\n**Cursor::save()** - Saves cursor position and attributes. Only one position can be saved at a time: each time you call save() it overrides previously saved position.\n\n**Cursor::restore()** - Restores cursor position and attributes\n\n```js\nconsole.write(\"OOOOO\\nOO\");\nconsole.cursor.save();\nconsole.write(\"OOO\\nOOOOO\\n\");\nconsole.cursor.restore();\nconsole.write(\"X\");\n```\n```\nOOOOO\nOOXOO\nOOOOO\n```\n\n### Screen\n**Screen::init()** - Saves current screen and created new empty session. Behavior is similar to such applications as Vim or Less.\n\n**Screen::restore()** - Restores screen saved by **Screen::init()**\n\n**Screen::clearUp()** - Clears screen up from cursor, including line to the left of cursor\n```js\nconsole.write(\"OOOOO\\nOOOOO\\nOOOOO\\n\");\nconsole.cursor.moveTo(2, 1);\nconsole.screen.clearUp();\n```\n```\n.....\n...OO\nOOOOO\n```\n\n**Screen::clearDown()** - Clears screen down from cursor, including line to the right of cursor\n```js\nconsole.write(\"OOOOO\\nOOOOO\\nOOOOO\\n\");\nconsole.cursor.moveTo(2, 1);\nconsole.screen.clearDown();\n```\n```\nOOOOO\nOO...\n.....\n```\n\n**Screen::clearLeft()** - Clears line to the left of cursor, including cursor position\n```js\nconsole.write(\"OOOOO\\nOOOOO\\nOOOOO\\n\");\nconsole.cursor.moveTo(2, 1);\nconsole.screen.clearLeft();\n```\n```\nOOOOO\n...OO\nOOOOO\n```\n\n**Screen::clearRight()** - Clears line to the right of cursor, including cursor position\n```js\nconsole.write(\"OOOOO\\nOOOOO\\nOOOOO\\n\");\nconsole.cursor.moveTo(2, 1);\nconsole.screen.clearRight();\n```\n```\nOOOOO\nOO...\nOOOOO\n```\n\n**Screen::clearLine()** - Clears entire line and moves cursor to the beginning of the line\n```js\nconsole.write(\"OOOOO\\nOOOOO\\nOOOOO\\n\");\nconsole.cursor.moveTo(2, 1);\nconsole.screen.clearLine();\nconsole.write(\"X\");\n```\n```\nOOOOO\nX....\nOOOOO\n```\n\n**Screen::clear()** - Clears entire screen and moves cursor to upper left corner\n","maintainers":[{"email":"d.ashesss+npmold@gmail.com","name":"d-ashesss"},{"email":"d.ashesss@gmail.com","name":"ashesss"}],"time":{"modified":"2022-06-14T07:24:25.891Z","created":"2015-06-23T21:27:16.501Z","0.1.0":"2015-06-23T21:27:16.501Z"},"homepage":"https://github.com/d-ashesss/node-console","keywords":["console","terminal"],"repository":{"type":"git","url":"https://github.com/d-ashesss/node-console.git"},"author":{"name":"Sergey Mashentsev","email":"d.ashesss@gmail.com"},"bugs":{"url":"https://github.com/d-ashesss/node-console/issues"},"license":"MIT","readmeFilename":"README.md"}