Skip to content
Sign upLog in
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
1

The prompt

TheDNAHero
TheDNAHero

When I enter a prompt, there is always a > before the prompt. How do I remove this? I am trying to mirror another project in a different language, and that is the only difference.

1 year ago

Voters

Comments

TopNew
1
li1201
li1201

It is probably because you are using the prompt() function which is a browser-designed function. Since you are using Node.JS, it would have to improvise and prompt with the >. Instead, you could use a Node module like readline. Link

1 year ago
1
TheDNAHero
TheDNAHero

@li1201
oh, but is there an easier way?

1 year ago
1
li1201
li1201

I am not sure, most likely not. You could convert your project to JS instead of Node.JS

@TheDNAHero

1 year ago
1
Highwayman
Highwayman

maybe try just process.stdin.read. That interface isn't too bad..


@TheDNAHero

1 year ago
1
Highwayman
Highwayman

or wait no it was more like

process.stdin.on('line', (line) => { // ... });

Or something. I'd have to read the docs again..


@Highwayman

1 year ago
1
Highwayman
Highwayman

oops, I mean on('data'.
ehe. Today is just not my day apparently, lol.


@Highwayman

1 year ago
Load more