summaryrefslogtreecommitdiff
path: root/doc/api/tty.md
AgeCommit message (Collapse)Author
2019-10-26doc: remove dashesRich Trott
The use of dashes -- in general, but especially in our docs -- can be problematic. It is used inconsistently and there is always another form of punctuation that is as good or better for the situation. In an effort to reduce the number of variations we use to display the same types of information, remove the various uses of dashes from the documentation. PR-URL: https://github.com/nodejs/node/pull/30101 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-10-10doc: escape brackets not used as markdown reference linksNick Schonning
These can turn into links if reference links are added to the document PR-URL: https://github.com/nodejs/node/pull/29809 Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-09-09doc: space around listsNick Schonning
Address markdownlint rule MD032. Flagged a few mixed list styles. PR-URL: https://github.com/nodejs/node/pull/29467 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-09-01doc: add extends for derived classesKamat, Trivikram
PR-URL: https://github.com/nodejs/node/pull/29290 Reviewed-By: James M Snell <jasnell@gmail.com>
2019-08-16readline: establish y in cursorTo as optionalGerhard Stoebich
Parameter y in cursorTo() is optional and this is also verified by tests but docs don't state this. Besides that if the newly added parameter callback is used with no y, it's quite unhandy. This PR allows to simply omit y. PR-URL: https://github.com/nodejs/node/pull/29128 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-07-232019-07-23, Version 12.7.0 (Current)Michaël Zasso
Notable changes: * deps: * Updated nghttp2 to 1.39.1. https://github.com/nodejs/node/pull/28448 * Updated npm to 6.10.0. https://github.com/nodejs/node/pull/28525 * esm: * Implemented experimental "pkg-exports" proposal. A new `"exports"` field can be added to a module's `package.json` file to provide custom subpath aliasing. See https://github.com/jkrems/proposal-pkg-exports/ for more information. https://github.com/nodejs/node/pull/28568 * http: * Added `response.writableFinished`. https://github.com/nodejs/node/pull/28681 * Exposed `headers`, `rawHeaders` and other fields on an `http.ClientRequest` `"information"` event. https://github.com/nodejs/node/pull/28459 * inspector: * Added `inspector.waitForDebugger()`. https://github.com/nodejs/node/pull/28453 * policy: * Added `--policy-integrity=sri` CLI option to mitigate policy tampering. If a policy integrity is specified and the policy does not have that integrity, Node.js will error prior to running any code. https://github.com/nodejs/node/pull/28734 * readline,tty: * Exposed stream API from various methods which write characters. https://github.com/nodejs/node/pull/28674 https://github.com/nodejs/node/pull/28721 * src: * Use cgroups to get memory limits. This improves the way we set the memory ceiling for a Node.js process. Previously we would use the physical memory size to estimate the necessary V8 heap sizes. The physical memory size is not necessarily the correct limit, e.g. if the process is running inside a docker container or is otherwise constrained. This change adds the ability to get a memory limit set by linux cgroups, which is used by docker containers to set resource constraints. https://docs.docker.com/config/containers/resource_constraints/ https://github.com/nodejs/node/pull/27508 PR-URL: https://github.com/nodejs/node/pull/28817
2019-07-18tty: expose stream API from readline methodscjihrig
This commit exposes the return value and callback of the underlying readline APIs from the tty module. PR-URL: https://github.com/nodejs/node/pull/28721 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-06-23doc: remove "note that" from tty.mdRich Trott
Refs: https://github.com/nodejs/remark-preset-lint-node/pull/16 PR-URL: https://github.com/nodejs/node/pull/28329 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-04-09doc: specify return type for tty.isatty()Mykola Bilochub
PR-URL: https://github.com/nodejs/node/pull/27154 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2019-03-282019-03-28, Version 11.13.0 (Current)Michaël Zasso
Notable changes: * crypto * Allow deriving public from private keys (Tobias Nießen) [#26278](https://github.com/nodejs/node/pull/26278). * events * Added a `once` function to use `EventEmitter` with promises (Matteo Collina) [#26078](https://github.com/nodejs/node/pull/26078). * tty * Added a `hasColors` method to `WriteStream` (Ruben Bridgewater) [#26247](https://github.com/nodejs/node/pull/26247). * Added NO_COLOR and FORCE_COLOR support (Ruben Bridgewater) [#26485](https://github.com/nodejs/node/pull/26485). * v8 * Added `v8.getHeapSnapshot` and `v8.writeHeapSnapshot` to generate snapshots in the format used by tools such as Chrome DevTools (James M Snell) [#26501](https://github.com/nodejs/node/pull/26501). * worker * Added `worker.moveMessagePortToContext`. This enables using MessagePorts in different vm.Contexts, aiding with the isolation that the vm module seeks to provide (Anna Henningsen) [#26497](https://github.com/nodejs/node/pull/26497). * C++ API * `AddPromiseHook` is now deprecated. This API was added to fill an use case that is served by `async_hooks`, since that has `Promise` support (Anna Henningsen) [#26529](https://github.com/nodejs/node/pull/26529). * Added a `Stop` API to shut down Node.js while it is running (Gireesh Punathil) [#21283](https://github.com/nodejs/node/pull/21283). * meta * [Gireesh Punathil](https://github.com/gireeshpunathil) is now a member of the Technical Steering Committee [#26657](https://github.com/nodejs/node/pull/26657). * Added [Yongsheng Zhang](https://github.com/ZYSzys) to collaborators [#26730](https://github.com/nodejs/node/pull/26730). PR-URL: https://github.com/nodejs/node/pull/26949
2019-03-19tty: add NO_COLOR and FORCE_COLOR supportRuben Bridgewater
This adds support to enforce a specific color depth by checking the `FORCE_COLOR` environment variable similar to `chalk`. On top of that we also add support for the `NO_COLOR` environment variable as suggested by https://no-color.org/. PR-URL: https://github.com/nodejs/node/pull/26485 Refs: https://github.com/nodejs/node/pull/26248 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2019-03-05tty: add hasColors functionRuben Bridgewater
This adds a small wrapper around the `getColorDepth` function to check if the stream supports at least a specific amount of colors. This is convenient as the other API is not as straight forward and most use cases likely only want to know if a specific amount of colors is supported or not. PR-URL: https://github.com/nodejs/node/pull/26247 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2018-11-28doc: sort bottom-of-file markdown linksSam Roberts
Reapply https://github.com/nodejs/node/pull/12726 It would be nice to have the sort check applied as part of doc testing, but this change doesn't implement that. PR-URL: https://github.com/nodejs/node/pull/24679 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-10-06tty: document `WriteStream.cursorTo()` and othersUmang Raghuvanshi
Adds documentation for the following `WriteStream` instance methods: - `WriteStream.clearLine()` - `WriteStream.clearScreenDown()` - `WriteStream.cursorTo()` - `WriteStream.getWindowSize()` - `WriteStream.moveCursor()` PR-URL: https://github.com/nodejs/node/pull/22893 Fixes: https://github.com/nodejs/node/issues/9853 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-09-22tty: make `readStream.setRawMode()` return `this`Alexander Mills
PR-URL: https://github.com/nodejs/node/pull/22950 Fixes: https://github.com/nodejs/node/issues/22916 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2018-07-15doc: declare all parameter typesSam Ruby
PR-URL: https://github.com/nodejs/node/pull/21782 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-05-03doc: add more missing backticksVse Mozhet Byt
Also, fix some other nits in passing (formatting, punctuation, typos, redundancy, obsoleteness). PR-URL: https://github.com/nodejs/node/pull/20438 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-04-25doc: fix net.Socket link inconsistenciesHackzzila
PR-URL: https://github.com/nodejs/node/pull/20271 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-04-04doc,tools: formalize, unify, codify default valuesVse Mozhet Byt
PR-URL: https://github.com/nodejs/node/pull/19737 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-03-212018-03-21, Version 9.9.0 (Current)Myles Borins
Notable changes: * assert: - From now on all error messages produced by `assert` in strict mode will produce a error diff. (Ruben Bridgewater) https://github.com/nodejs/node/pull/17615 - From now on it is possible to use a validation object in throws instead of the other possibilities. (Ruben Bridgewater) https://github.com/nodejs/node/pull/17584 * crypto: - allow passing null as IV unless required (Tobias Nießen) https://github.com/nodejs/node/pull/18644 * fs: - support as and as+ flags in stringToFlags() (Sarat Addepalli) https://github.com/nodejs/node/pull/18801 * tls: - expose Finished messages in TLSSocket (Anton Salikhmetov) https://github.com/nodejs/node/pull/19102 * tty: - Add getColorDepth function to determine if terminal supports colors (Ruben Bridgewater) https://github.com/nodejs/node/pull/17615 * util: - add util.inspect compact option (Ruben Bridgewater) https://github.com/nodejs/node/pull/17576 * **Added new collaborators** - [watson](https://github.com/watson) Thomas Watson PR-URL: https://github.com/nodejs/node/pull/19428
2018-02-01doc: linkify missing typesVse Mozhet Byt
Also, alphabetize all types in type-parser.js and fix some nits in type formats. PR-URL: https://github.com/nodejs/node/pull/18444 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-01-24tty: add getColorDepth functionRuben Bridgewater
Right now it is very difficult to determine if a terminal supports colors or not. This function adds this functionality by detecting environment variables and checking process. PR-URL: https://github.com/nodejs/node/pull/17615 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-12-18doc: adjust TTY wording & add inter-doc linksJeremiah Senkpiel
PR-URL: https://github.com/nodejs/node/pull/17702 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2017-11-07doc: add isTTY property documentationSonaySevik
PR-URL: https://github.com/nodejs/node/pull/16828 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2017-10-26doc, win: remove note about resizeBartosz Sosnowski
Libuv 1.15.0 improved console resize detection on Windows. This note is no longer needed. PR-URL: https://github.com/nodejs/node/pull/16320 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-10-22tty,doc: add type-check to isattyBryan English
Previously, various inputs other than non-negative integers would produce incorrect results. Added type-checking on input, returning false for anything other than non-negative integers. Also clarified in docs. PR-URL: https://github.com/nodejs/node/pull/15567 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2017-08-28doc: add links to alternative versions of docChris Young
Each page of the API documentation should have links to other versions of the same page. This will make it easier to switch between the current "live" release at nodejs.org and LTS versions. PR-URL: https://github.com/nodejs/node/pull/10958 Fixes: https://github.com/nodejs/node/issues/10726 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-07-09doc: note 'resize' event conditions on WindowsDean Coakley
PR-URL: https://github.com/nodejs/node/pull/13576 Fixes: https://github.com/nodejs/node/issues/13197 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
2016-12-08doc: add some info on `tty#setRawMode()`Jeremiah Senkpiel
Partially taken from https://linux.die.net/man/3/cfmakeraw A very simple test script: ``` if (process.argv[2] === 'raw') process.stdin.setRawMode(true) process.stdin.on('data', (chunk) => { console.log(chunk) console.log(chunk.toString()) }) ``` Refs: https://github.com/nodejs/node/pull/10037 PR-URL: https://github.com/nodejs/node/pull/10147 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-08-04doc: use blockquotes for Stability: markersAnna Henningsen
Use blockquotes instead of code blocks for stability markers in the docs. Doing that: - Makes the makers appear correctly when viewed e.g. on github. - Allows remark-lint rules like `no-undefined-references` to work properly (https://github.com/nodejs/node/pull/7729). PR-URL: https://github.com/nodejs/node/pull/7757 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
2016-07-14doc: various documentation formatting fixesСковорода Никита Андреевич
* Fix markdown code sample in releases.md, it was <a id="x.y.x></a>" * Fix some markdown errors, e.g. in changelogs * Fix broken defs links, e.g. in domain-postmortem.md * Fix other broken refs, by addaleax * Add links to some defs that were present but not linked to * Remove dead defs * Move defs to the bottom (one file affected) * Add language indicators to all code blocks, using `txt` when no specific language could be chosen * Some minor formatting changes (spaces, ident, headings) PR-URL: https://github.com/nodejs/node/pull/7637 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Roman Reiss <me@silverwind.io>
2016-05-27doc: general improvements to tty.mdJames M Snell
PR-URL: https://github.com/nodejs/node/pull/6931 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2016-05-17doc: add `added:` in for `tty`Rich Trott
Refs: https://github.com/nodejs/node/issues/6578 PR-URL: https://github.com/nodejs/node/pull/6783 Reviewed-By: James M Snell <jasnell@gmail.com>
2016-04-20doc: git mv to .mdRobert Jefe Lindstaedt
* doc: rename .markdown references in content * doc: rename to .md in tools * doc: rename to .md in CONTRIBUTING.md PR-URL: https://github.com/nodejs/node/pull/4747 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: techjeffharris Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>