Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[@types/node] missing cursorTo(), moveCursor() in process.stdout #31505

Closed
4 tasks done
jinliming2 opened this issue Dec 18, 2018 · 8 comments
Closed
4 tasks done

[@types/node] missing cursorTo(), moveCursor() in process.stdout #31505

jinliming2 opened this issue Dec 18, 2018 · 8 comments

Comments

@jinliming2
Copy link
Contributor

Missing cursorTo(), moveCursor() in process.stdout

  • I tried using the @types/xxxx package and had problems.
  • I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
  • I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).
  • Mention the authors (see Definitions by: in index.d.ts) so they can respond.
@SimonSchick SimonSchick mentioned this issue Feb 7, 2019
3 tasks
@SimonSchick
Copy link
Contributor

@basarat This can be closed, also is there an alias I can ping to get any ts contributor?

@basarat
Copy link
Member

basarat commented Jul 4, 2019

also is there an alias I can ping to get any ts contributor?

I haven't been active here for quite a while. Just jumped in because your messages started with an @ to me 🌹

You could ping @DefinitelyTyped/typescript-team but I'm not sure if that's the workflow at the moment, You can ask in https://gitter.im/DefinitelyTyped/DefinitelyTyped if you wanted 🤷‍♂

Missing cursorTo(), moveCursor() in process.stdout

@jinliming2 Can I have an example code that should work so I can test that it is indeed done. Don't think the following is valid:

process.stdout.moveCursor; 
process.stdout.cursorTo; 

@SimonSchick
Copy link
Contributor

Welcome to Node.js v12.3.1.
Type ".help" for more information.
> process.stdout.moveCursor
process.stdout.moveCursor

> process.stdout.moveCursor
[Function]
> process.stdout.cursorTo
[Function]
>

They are, I validated this before adding the typings.

@basarat
Copy link
Member

basarat commented Jul 5, 2019

I made a code sandbox : https://codesandbox.io/s/romantic-panini-ypmq0?fontsize=14
Using @types/node latest : 12.0.12
I get TS errors (If types were added I would have expected no error):

image

process.stdout; // no error 
process.stdout.moveCursor; // TS Error: Property moveCursor does not exist on WriteStream
process.stdout.cursorTo; // TS Error : Property cursorTo does not exist on WriteStream

Let me know if I've missed something (likely) 🌹

@SimonSchick
Copy link
Contributor

Uhh, that's odd, let me backtrack this.

@joshiefishbein
Copy link

I'm able to reproduce this problem with "@types/node": "^12.7.2".

@G-Rath
Copy link
Contributor

G-Rath commented Jul 11, 2020

@SimonSchick fwiw these should be optional on process.stdout, as it depends on how Node is being run (at least on node 14): if piped, process.stdout is an instance of SyncWriteStream, otherwise it's an instance of WriteStream.

console.log('hello world');

process.stdout.moveCursor('hello'.length + 1, -1);
process.stdout.clearLine(1);

console.log('sunshine');
test/fixtures/mkdirp_and_cryo on  master took 11s
❯ ts-node -T ./myfile.ts
hello sunshine

test/fixtures/mkdirp_and_cryo on  master
❯ ts-node -T ./myfile.ts  > f

/c/Users/G-Rath/workspace/projects-personal/audit-app/test/fixtures/mkdirp_and_cryo/myfile.ts:3
process.stdout.moveCursor('hello'.length + 1, -1);
               ^
TypeError: process.stdout.moveCursor is not a function
    at Object.<anonymous> (/c/Users/G-Rath/workspace/projects-personal/audit-app/test/fixtures/mkdirp_and_cryo/myfile.ts:3:16)
    at Module._compile (internal/modules/cjs/loader.js:1200:30)
    at Module.m._compile (/home/g-rath/.nodenv/versions/14.4.0/lib/node_modules/ts-node/src/index.ts:858:23)
    at Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
    at Object.require.extensions.<computed> [as .ts] (/home/g-rath/.nodenv/versions/14.4.0/lib/node_modules/ts-node/src/index.ts:861:12)
    at Module.load (internal/modules/cjs/loader.js:1049:32)
    at Function.Module._load (internal/modules/cjs/loader.js:937:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at main (/home/g-rath/.nodenv/versions/14.4.0/lib/node_modules/ts-node/src/bin.ts:227:14)
    at Object.<anonymous> (/home/g-rath/.nodenv/versions/14.4.0/lib/node_modules/ts-node/src/bin.ts:513:3)

@orta orta closed this as completed Jun 7, 2021
@orta
Copy link
Collaborator

orta commented Jun 7, 2021

Hi thread, we're moving DefinitelyTyped to use GitHub Discussions for conversations the @types modules in DefinitelyTyped.

To help with the transition, we're closing all issues which haven't had activity in the last 6 months, which includes this issue. If you think closing this issue is a mistake, please pop into the TypeScript Community Discord and mention the issue in the definitely-typed channel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants