4 ms·
What's the point of implementing something like this completely in Javascript? Isn't this a good example of something that should be developed in a lower-level,
by smoldesu 6y ago
What's the point of implementing something like this completely in Javascript? Isn't this a good example of something that should be developed in a lower-level, faster language?
- OhSoHumble 6y agoPersonally, I avoid languages that require a runtime when developing CLIs. Nothing worse than telling your users "just make sure that you're running the right version of Ruby/Python/Node."
- qbasic_forever 6y agoThis and other JS CLI libraries are typically used by JS projects that have tooling. Like when create-react-app scaffolds a project and asks you questions to customize it, etc. it's using libraries like this one. For a JS project it's just an easy npm install away as a dependency, and you know your users will have nodejs anyways. Speed rarely matters for imperative user-facing tools. You're going to be waiting for a user to type and respond far, far longer than making some system calls to write to the shell. Ink is a more interesting and maintained library to consider though: https://github.com/vadimdemedes/ink https://github.com/vadimdemedes/ink It lets you write react-like apps that output to the terminal instead of HTML.
- cheriot 6y agoThere's similar libraries for python[1], golang[2], rust[3]. Drawing on the terminal isn't that resource intensive so I'd stay in whatever ecosystem I have a reason to be in. 1. https://github.com/willmcgugan/rich https://github.com/willmcgugan/rich 2. https://github.com/gizak/termui https://github.com/gizak/termui 3. https://github.com/fdehau/tui-rs https://github.com/fdehau/tui-rs Notably absent is the JVM. Another victim of startup time I imagine.
- jpavel2 6y agoAn actively developed and mature text UI library for the JVM: https://github.com/mabe02/lanterna https://github.com/mabe02/lanterna
- curioussavage 6y agoAs the other response pointed out it’s not a big deal. Needing a runtime is a small bummer though node is easily installable everywhere now. What I really like about blessed was it’s api. At one point I made my own fork and was going to try to maintain it. Then I thought I’d try to port it to nim. These days I just use one of the excellent text ui libs in go which is great mostly because of the ecosystem.