{"name":"node-pty","description":"Fork pseudoterminals in Node.JS","author":{"name":"Microsoft Corporation"},"version":"0.8.2-beta1","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","prepublish":"npm run tsc"},"dependencies":{"nan":"2.12.1"},"devDependencies":{"@types/mocha":"^5.0.0","@types/node":"^6.0.104","cross-env":"^5.1.4","mocha":"^5.0.5","pollUntil":"^1.0.3","ps-list":"^6.0.0","tslint":"^5.12.1","tslint-consistent-codestyle":"^1.15.0","typescript":"^3.2.2"},"gitHead":"6b5ff701e8e901c0e78e422d8e72386174bdc01a","readme":"# node-pty\r\n\r\n[![Build Status](https://dev.azure.com/vscode/node-pty/_apis/build/status/Microsoft.node-pty)](https://dev.azure.com/vscode/node-pty/_apis/build/status/Microsoft.node-pty?branchName=master)\r\n\r\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.\r\n\r\nThis is useful for:\r\n\r\n- Writing a terminal emulator (eg. via [xterm.js](https://github.com/sourcelair/xterm.js)).\r\n- Getting certain programs to *think* you're a terminal, such as when you need a program to send you control sequences.\r\n\r\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.\r\n\r\n## Real-world Uses\r\n\r\n`node-pty` powers many different terminal emulators, including:\r\n\r\n- [Microsoft Visual Studio Code](https://code.visualstudio.com)\r\n- [Hyper](https://hyper.is/)\r\n- [Upterm](https://github.com/railsware/upterm)\r\n- [Script Runner](https://github.com/ioquatix/script-runner) for Atom.\r\n- [Theia](https://github.com/theia-ide/theia)\r\n- [FreeMAN](https://github.com/matthew-matvei/freeman) file manager\r\n- [atom-xterm](https://atom.io/packages/atom-xterm) - Atom plugin for providing terminals inside your Atom workspace.\r\n- [Termination](https://atom.io/packages/termination) - Another Atom plugin that provides terminals inside your Atom workspace.\r\n- [electerm](https://github.com/electerm/electerm) Terminal/ssh/sftp client(linux, mac, win).\r\n- [Extraterm](http://extraterm.org/)\r\n\r\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.\r\n\r\n## Example Usage\r\n\r\n```js\r\nvar os = require('os');\r\nvar pty = require('node-pty');\r\n\r\nvar shell = os.platform() === 'win32' ? 'powershell.exe' : 'bash';\r\n\r\nvar ptyProcess = pty.spawn(shell, [], {\r\n  name: 'xterm-color',\r\n  cols: 80,\r\n  rows: 30,\r\n  cwd: process.env.HOME,\r\n  env: process.env\r\n});\r\n\r\nptyProcess.on('data', function(data) {\r\n  process.stdout.write(data);\r\n});\r\n\r\nptyProcess.write('ls\\r');\r\nptyProcess.resize(100, 40);\r\nptyProcess.write('ls\\r');\r\n```\r\n\r\n## Building\r\n\r\n```bash\r\n# Install dependencies and build C++\r\nnpm install\r\n# Compile TypeScript -> JavaScript\r\nnpm run tsc\r\n```\r\n\r\n## Dependencies\r\n\r\n### Linux/Ubuntu\r\n\r\n```\r\nsudo apt install -y make python build-essential\r\n```\r\n\r\nThe following are also needed:\r\n\r\n- Node.JS 10+\r\n\r\n### Windows\r\n\r\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:\r\n\r\n```sh\r\nnpm install --global --production windows-build-tools\r\n```\r\n\r\nThe following are also needed:\r\n\r\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\r\n- Node.JS 10+\r\n\r\n## Debugging\r\n\r\n[The wiki](https://github.com/Microsoft/node-pty/wiki/Debugging) contains instructions for debugging node-pty.\r\n\r\n## Security\r\n\r\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.\r\n\r\n## Thread Safety\r\n\r\nNote that node-pty is not thread safe so running it across multiple worker threads in node.js could cause issues.\r\n\r\n## Troubleshooting\r\n\r\n### Powershell gives error 8009001d\r\n\r\n> Internal Windows PowerShell error.  Loading managed Windows PowerShell failed with error 8009001d.\r\n\r\nThis happens when PowerShell is launched with no `SystemRoot` environment variable present.\r\n\r\n### ConnectNamedPipe failed: Windows error 232\r\n\r\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`\r\n\r\n## pty.js\r\n\r\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.\r\n\r\n## License\r\n\r\nCopyright (c) 2012-2015, Christopher Jeffrey (MIT License).<br>\r\nCopyright (c) 2016, Daniel Imms (MIT License).<br>\r\nCopyright (c) 2018, Microsoft Corporation (MIT License).\r\n","readmeFilename":"README.md","_id":"node-pty@0.8.2-beta1","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"tyriar","email":"tyriar@tyriar.com"},"dist":{"integrity":"sha512-1y2/BUFRZ8gtkVZuX+wV8+qvSNQl1vVo4wVzijvtg96/evaJH7mwyGB/Cx4pcWwbkfngbLestz8Sbda4+8xQgg==","shasum":"0bd69db8e684bb5a09a09057208f36fbb951fd48","tarball":"http://registry-npm.ywwl.com/node-pty/download/node-pty-0.8.2-beta1.tgz","fileCount":239,"unpackedSize":1086152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcyxAdCRA9TVsSAnZWagAAgoAP/1FUi/XUQvZrJt3rqR2f\n9LqppODkr9SkY8gCfnrpIWbB4+K6Xa/txhRS6e1qlYvS9cjt75i/Y9ZbEFg0\nIJxg17cyZu3XQ2iZEf9TbTaGg9j5czJlxI1o1Jl1OLT/qR7YsTSGbOfEpq4o\nU3Ec/yTy1c6p6mQPktxgo5kzP3I+J1g0PxXbuU+C3f0cJIWKyY83tbUkfJPp\nyLT/sgPkdguYdD8z0lFijwQaN9iMFcKnY2kCmiFo7IpOiH2P+UYiiem+pWWh\n7Z9orYP5nmfc0hoUk6PzQwBJbOfuzVVhmzXFn+xu0sbUbtxUa1fssIcztqZw\nSscNqN0wVjViYMQAgWwYMHjOW7/orTEPtMCvY12j8+HPF+z2yOH153v/I0dE\nzfLodPqxLKxzHdHw0NIn1og66Xxpt8AL5TYX4jFhOHgpMP/STH8/f+rCB7pG\n4AEglNMstOs5Mk7rCOkLowkd5DL/tOMLyiW6RvUGvCvGVxmy1w+GXwYVrmd8\nS/Tr6d1tK/VLV6/N5GubwKD1JVsdwVExC21NMymrqB+xHE2Hk2SsuE3Tj3Pk\nuV+1GnJBzjDt4kAYE/kAbYJwNHg2/7fjouQ7RdnKGAlofqTf+v5F0sDf8tG4\nSXNyLKF9btRuUJ5rf9tq3qfzGJciPDE4fS6fVzQCP9Wbk2ba6nV28jWEG+5U\nMSlG\r\n=SZTN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCoVmAbyLyOrubNEkIBcZTWiP0xUQESLkJ0tD1gDh+1nwIgac7AVLbnOLe7AjZpuQCXPzWdyBkelUkKqIA2GAtjyys="}],"size":232607,"noattachment":false,"key":"/node-pty/-/node-pty-0.8.2-beta1.tgz"},"maintainers":[{"email":"alros@microsoft.com","name":"alexr00"},{"email":"npmjs@microsoft.com","name":"microsoft"},{"email":"tyriar@tyriar.com","name":"tyriar"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-pty_0.8.2-beta1_1556811805171_0.715811009937962"},"_hasShrinkwrap":false,"publish_time":1556811805400,"_cnpm_publish_time":1556811805400,"dist-tags":{"alpha":"0.10.0-alpha1","beta":"1.2.0-beta.18","conpty":"0.7.8-conpty1","latest":"1.1.0"}}