{"name":"node-pty","description":"Fork pseudoterminals in Node.JS","author":{"name":"Microsoft Corporation"},"version":"0.11.0-beta18","license":"MIT","main":"./lib/index.js","types":"./typings/node-pty.d.ts","repository":{"type":"git","url":"git://github.com/microsoft/node-pty.git"},"homepage":"https://github.com/microsoft/node-pty","bugs":{"url":"https://github.com/microsoft/node-pty/issues"},"keywords":["pty","tty","terminal","pseudoterminal","forkpty","openpty"],"scripts":{"build":"tsc -b ./src/tsconfig.json","watch":"tsc -b -w ./src/tsconfig.json","lint":"eslint -c .eslintrc.js --ext .ts src/","install":"node scripts/install.js","postinstall":"node scripts/post-install.js","test":"cross-env NODE_ENV=test mocha -R spec --exit lib/*.test.js","posttest":"npm run lint","prepare":"npm run build","prepublishOnly":"npm run build"},"dependencies":{"nan":"^2.14.0"},"devDependencies":{"@types/mocha":"^7.0.2","@types/node":"12","@typescript-eslint/eslint-plugin":"^2.27.0","@typescript-eslint/parser":"^2.27.0","cross-env":"^5.1.4","eslint":"^6.8.0","mocha":"^7.1.1","ps-list":"^6.0.0","typescript":"^3.8.3"},"peerDependencies":{"node-gyp":"^8.3.0"},"gitHead":"a858198d5ed6c166d942ed05f3c0aaad03ca0e9c","readme":"# node-pty\n\n[![Build Status](https://dev.azure.com/vscode/node-pty/_apis/build/status/Microsoft.node-pty?branchName=main)](https://dev.azure.com/vscode/node-pty/_build/latest?definitionId=11&branchName=main)\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## API\n\nThe full API for node-pty is contained within the [TypeScript declaration file](https://github.com/microsoft/node-pty/blob/main/typings/node-pty.d.ts), use the branch/tag picker in GitHub (`w`) to navigate to the correct version of the API.\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## 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- [DockerStacks](https://github.com/sfx101/docker-stacks) Local LAMP/LEMP stack using Docker\n- [TeleType](https://github.com/akshaykmr/TeleType): cli tool that allows you to share your terminal online conveniently. Show off mad cli-fu, help a colleague, teach, or troubleshoot.\n- [mesos-term](https://github.com/criteo/mesos-term): A web terminal for Apache Mesos. It allows to execute commands within containers.\n- [Commas](https://github.com/CyanSalt/commas): A hackable terminal and command runner.\n- [ENiGMA½ BBS Software](https://github.com/NuSkooler/enigma-bbs): A modern BBS software with a nostalgic flair!\n- [Tinkerun](https://github.com/tinkerun/tinkerun): A new way of running Tinker.\n- [Tess](https://tessapp.dev): Hackable, simple and rapid terminal for the new era of technology 👍\n- [NxShell](https://nxshell.github.io/): An easy to use new terminal for Windows/Linux/MacOS platform.\n- [OpenSumi](https://github.com/opensumi/core): A framework helps you quickly build Cloud or Desktop IDE products.\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## Building\n\n```bash\n# Install dependencies and build C++\nnpm install\n# Compile TypeScript -> JavaScript\nnpm run build\n```\n\n## Dependencies\n\nNode.JS 12+ or Electron 8+ is required to use `node-pty`.\n\n### Linux (apt)\n\n```sh\nsudo apt install -y make python build-essential\n```\n\n### macOS\n\nXcode is needed to compile the sources, this can be installed from the App Store.\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\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 child program\n...\nptyProcess.write(RESUME); // pty will enter flow mode and resume the child 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.11.0-beta18","_nodeVersion":"12.22.10","_npmVersion":"6.14.16","dist":{"integrity":"sha512-r+jDtgTRGSQwonm3Wl3gNKBctnjkPD62Vjvi7paSm5+avFbMTYwI9V7Q+3+NyEaBas6eBv6kfHL3WoYSHdrQ6g==","shasum":"6e508673372fc3006ed8fe7a4501cbad83b56a91","tarball":"http://registry-npm.ywwl.com/node-pty/download/node-pty-0.11.0-beta18.tgz","fileCount":255,"unpackedSize":1129168,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFQK2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqrxQ/9GlxmoiMmxCQkuwmBVZEzkwd9frz6yfZ6tJwk7GoSB7CAX3rA\r\npwh9iVTURzFbI9LUwccTicE3zfFkx1KfbgJfXSZQQLTK64S3FePKogdDeBFF\r\nJRYpKkqj/w3QaTULyG4VsuxB1qKYmkaZswSNVOXGaZk4cbdzjszdWAOhnJe9\r\nJzN9veSeoOW8oik0ztk5iyqyBJW+/cmBASSLrcJSE5D+Ehm7stcqlT6am341\r\nUBg4nwDMw4RFxvyPr6VWweOk8LmU1lJGgq+AmbVsxBeTMn8TLz49O8JKZx6s\r\nd63CDzgBIUp2Kiaez6Vi7Jk910uY+jhmNqANNsu5g4ItOJLINZO4kIjlq9vX\r\n0hBrCcw+uNwShNMR9SQanOqEOpR6o+ezKl4v35S0fBcl7a/HR58YL5oL8EVi\r\naOFPbzzOV8U++ImY6jg2yQ62+O5PjUPTMSE6Smv+nJt3Ylwu7B7mGymcS+rL\r\nscrNJ8CYmfeLtLPla0b8LDWR1xQmQ6OlUl/6o7aLeAV5nx9mCqadWvEKq6+B\r\njutUB3287cIpsBklgIoV+0IkC0s4lnu6r9Vbc0c6f6U99i7lr/OdsCFCvo65\r\nqqFlSW3UxiaPruWnJ9gTrS2wKAqOfSa9ygRPM2FMgh/dX39cMPJUNEWREaMz\r\nBpOXWTtC5/Vk/oq7fHG6GDQ1W+Dzbni4MhA=\r\n=EQQO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH+FkOCgLHSwK/c5HO8GKXZyDH9T5m8+RcW+5G4JupUgAiBVi2PhLdUKosvu09kV5ns9g3dDvejJxPR0w5mu+nInXQ=="}],"size":251068,"noattachment":false,"key":"/node-pty/-/node-pty-0.11.0-beta18.tgz"},"_npmUser":{"name":"tyriar","email":"tyriar@tyriar.com"},"directories":{},"maintainers":[{"name":"tyriar","email":"tyriar@tyriar.com"},{"name":"alexr00","email":"alros@microsoft.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-pty_0.11.0-beta18_1645544118465_0.11376841382397984"},"_hasShrinkwrap":false,"publish_time":1645544118686,"_cnpm_publish_time":1645544118686,"dist-tags":{"alpha":"0.10.0-alpha1","beta":"1.2.0-beta.18","conpty":"0.7.8-conpty1","latest":"1.1.0"}}