{"name":"node-pty","description":"Fork pseudoterminals in Node.JS","author":{"name":"Microsoft Corporation"},"version":"0.10.0-beta6","license":"MIT","main":"./lib/index.js","types":"./typings/node-pty.d.ts","repository":{"type":"git","url":"git://github.com/Tyriar/node-pty.git"},"homepage":"https://github.com/Tyriar/node-pty","bugs":{"url":"https://github.com/Tyriar/node-pty/issues"},"keywords":["pty","tty","terminal","pseudoterminal","forkpty","openpty"],"scripts":{"tsc":"tsc","watch":"tsc -w","lint":"tslint 'src/**/*.ts'","install":"node scripts/install.js","postinstall":"node scripts/post-install.js","test":"cross-env NODE_ENV=test mocha -R spec --exit lib/*.test.js","prepare":"npm run tsc","prepublishOnly":"npm run tsc"},"dependencies":{"nan":"^2.14.0"},"devDependencies":{"@types/mocha":"^7.0.2","@types/node":"8","cross-env":"^5.1.4","mocha":"^7.1.1","ps-list":"^6.0.0","tslint":"5.12.1","tslint-consistent-codestyle":"^1.15.0","typescript":"3.4"},"gitHead":"bfa67c19f540820bfab8720c92a56af34f126b57","readme":"# node-pty\n\n[![Build Status](https://dev.azure.com/vscode/node-pty/_apis/build/status/Microsoft.node-pty)](https://dev.azure.com/vscode/node-pty/_build/latest?definitionId=11)\n\n`forkpty(3)` bindings for node.js. This allows you to fork processes with pseudoterminal file descriptors. It returns a terminal object which allows reads and writes.\n\nThis is useful for:\n\n- Writing a terminal emulator (eg. via [xterm.js](https://github.com/sourcelair/xterm.js)).\n- Getting certain programs to *think* you're a terminal, such as when you need a program to send you control sequences.\n\n`node-pty` supports Linux, macOS and Windows. Windows support is possible by utilizing the [Windows conpty API](https://blogs.msdn.microsoft.com/commandline/2018/08/02/windows-command-line-introducing-the-windows-pseudo-console-conpty/) on Windows 1809+ and the [winpty](https://github.com/rprichard/winpty) library in older version.\n\n## Real-world Uses\n\n`node-pty` powers many different terminal emulators, including:\n\n- [Microsoft Visual Studio Code](https://code.visualstudio.com)\n- [Hyper](https://hyper.is/)\n- [Upterm](https://github.com/railsware/upterm)\n- [Script Runner](https://github.com/ioquatix/script-runner) for Atom.\n- [Theia](https://github.com/theia-ide/theia)\n- [FreeMAN](https://github.com/matthew-matvei/freeman) file manager\n- [terminus](https://atom.io/packages/terminus) - An Atom plugin for providing terminals inside your Atom workspace.\n- [x-terminal](https://atom.io/packages/x-terminal) - Also an Atom plugin that provides terminals inside your Atom workspace.\n- [Termination](https://atom.io/packages/termination) - Also an Atom plugin that provides terminals inside your Atom workspace.\n- [atom-xterm](https://atom.io/packages/atom-xterm) - Also an Atom plugin that provides terminals inside your Atom workspace.\n- [electerm](https://github.com/electerm/electerm) Terminal/SSH/SFTP client(Linux, macOS, Windows).\n- [Extraterm](http://extraterm.org/)\n- [Wetty](https://github.com/krishnasrinivas/wetty) Browser based Terminal over HTTP and HTTPS\n- [nomad](https://github.com/lukebarnard1/nomad-term)\n\nDo you use node-pty in your application as well? Please open a [Pull Request](https://github.com/Tyriar/node-pty/pulls) to include it here. We would love to have it in our list.\n\n## Example Usage\n\n```js\nvar os = require('os');\nvar pty = require('node-pty');\n\nvar shell = os.platform() === 'win32' ? 'powershell.exe' : 'bash';\n\nvar ptyProcess = pty.spawn(shell, [], {\n  name: 'xterm-color',\n  cols: 80,\n  rows: 30,\n  cwd: process.env.HOME,\n  env: process.env\n});\n\nptyProcess.on('data', function(data) {\n  process.stdout.write(data);\n});\n\nptyProcess.write('ls\\r');\nptyProcess.resize(100, 40);\nptyProcess.write('ls\\r');\n```\n\n## Building\n\n```bash\n# Install dependencies and build C++\nnpm install\n# Compile TypeScript -> JavaScript\nnpm run tsc\n```\n\n## Dependencies\n\n### Linux/Ubuntu\n\n```\nsudo apt install -y make python build-essential\n```\n\nThe following are also needed:\n\n- Node.JS 10+\n\n### Windows\n\n`npm install` requires some tools to be present in the system like Python and C++ compiler. Windows users can easily install them by running the following command in PowerShell as administrator. For more information see https://github.com/felixrieseberg/windows-build-tools:\n\n```sh\nnpm install --global --production windows-build-tools\n```\n\nThe following are also needed:\n\n- [Windows SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk) - only the \"Desktop C++ Apps\" components are needed to be installed\n- Node.JS 10+\n\n## Debugging\n\n[The wiki](https://github.com/Microsoft/node-pty/wiki/Debugging) contains instructions for debugging node-pty.\n\n## Security\n\nAll processes launched from node-pty will launch at the same permission level of the parent process. Take care particularly when using node-pty inside a server that's accessible on the internet. We recommend launching the pty inside a container to protect your host machine.\n\n## Thread Safety\n\nNote that node-pty is not thread safe so running it across multiple worker threads in node.js could cause issues.\n\n## Flow Control\n\nAutomatic flow control can be enabled by either providing `handleFlowControl = true` in the constructor options or setting it later on:\n\n```js\nconst PAUSE = '\\x13';   // XOFF\nconst RESUME = '\\x11';  // XON\n\nconst ptyProcess = pty.spawn(shell, [], {handleFlowControl: true});\n\n// flow control in action\nptyProcess.write(PAUSE);  // pty will block and pause the slave program\n...\nptyProcess.write(RESUME); // pty will enter flow mode and resume the slave program\n\n// temporarily disable/re-enable flow control\nptyProcess.handleFlowControl = false;\n...\nptyProcess.handleFlowControl = true;\n```\n\nBy default `PAUSE` and `RESUME` are XON/XOFF control codes (as shown above). To avoid conflicts in environments that use these control codes for different purposes the messages can be customized as `flowControlPause: string` and `flowControlResume: string` in the constructor options. `PAUSE` and `RESUME` are not passed to the underlying pseudoterminal if flow control is enabled.\n\n## Troubleshooting\n\n### Powershell gives error 8009001d\n\n> Internal Windows PowerShell error.  Loading managed Windows PowerShell failed with error 8009001d.\n\nThis happens when PowerShell is launched with no `SystemRoot` environment variable present.\n\n### ConnectNamedPipe failed: Windows error 232\n\nThis error can occur due to anti-virus software intercepting winpty from creating a pty. To workaround this you can exclude this file from your anti-virus scanning `node-pty\\build\\Release\\winpty-agent.exe`\n\n## pty.js\n\nThis project is forked from [chjj/pty.js](https://github.com/chjj/pty.js) with the primary goals being to provide better support for later Node.JS versions and Windows.\n\n## License\n\nCopyright (c) 2012-2015, Christopher Jeffrey (MIT License).<br>\nCopyright (c) 2016, Daniel Imms (MIT License).<br>\nCopyright (c) 2018, Microsoft Corporation (MIT License).\n","readmeFilename":"README.md","_id":"node-pty@0.10.0-beta6","_nodeVersion":"8.17.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-UnEJhaz2qUUE8GlSqbIpb7hhdNY/7WXXb5hAxJG2MRadEQUCiGtl8O0m6lP4MnHxI750odgOi7KgU/xO3PLRWw==","shasum":"15c1aadd5ff1c4a2d124a902e0c3fce099e0b35a","tarball":"http://registry-npm.ywwl.com/node-pty/download/node-pty-0.10.0-beta6.tgz","fileCount":243,"unpackedSize":1089614,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejH3qCRA9TVsSAnZWagAAoy4P/28XS8f1UL2+wbzOR80y\nyj+1VV3Z8cwxKfaEsc6p6hWVdgNn2u+lv3Tlcxp5SQPOp0D5lEirIVkT1faB\nRDwDjN4ZZ5wCCxGlIQ8dZcR1EgIGmimVKGfHN8xjgjcN4KSSRzDCMzjAMpfS\nw5YNPRqE062fSJqDTwnP5PgYSp/N5SiBUOEg9Je047cuMV8ch9UhFoG47ia2\nUezT9gqkP6pM8D4GXOSIqab7Q6sVEyUK5QRDXWAIa4qTeex27X1N468UvHKx\nBsKXpm+VqVxnG5Sau9OgZ5kFYoC1iNxOLCmbG4MBFZ2cdno7umsKJQvSlO85\naWIKz2Vpn6dlX6QMD4EGLVTzhDp+4jH10EXFVYS9FHpGk6OqAzdDJwhcichf\nYPwRsXdJ8w1/m/EmEUzrhXHB9dLAUkAYu3O0gYNV9F4Pu906T1ywVJsUqBiu\nSM6Kknkvn7bxVKrI83PkHitVO+B/vpIdDCnM5a2TJwSalJ9+WQsZ8drhrBx+\n7CkKVUSTNTy4mFXqB9knLjISribvoJ0glHu3UJc/X69O9P/cX2o8AvMyLQxM\ndu3DFpcOSoKsrRhN83dlMNe5+1ax/6ktHq+yY+GbuwsVpgx74BObVkQQKpNi\nU1Q8VNlcGyNagD75sx3GAdd1SU/nSRjolaZrCl016udoHXxrnsgGI9BABqjz\nst16\r\n=851z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgp7n8eGfHGEMORFsLzBWB7D//JLWRzIfHXhF7YJqrcAIgG+/6aBxHFdmAy6FUj5jArjafANTLL6o/7l1htwKZ9uM="}],"size":240876,"noattachment":false,"key":"/node-pty/-/node-pty-0.10.0-beta6.tgz"},"maintainers":[{"email":"alros@microsoft.com","name":"alexr00"},{"email":"npmjs@microsoft.com","name":"microsoft"},{"email":"tyriar@tyriar.com","name":"tyriar"}],"_npmUser":{"name":"tyriar","email":"tyriar@tyriar.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-pty_0.10.0-beta6_1586265578260_0.5732852697233053"},"_hasShrinkwrap":false,"publish_time":1586265578472,"_cnpm_publish_time":1586265578472,"dist-tags":{"alpha":"0.10.0-alpha1","beta":"1.2.0-beta.18","conpty":"0.7.8-conpty1","latest":"1.1.0"}}