4 ms·
The article mentions using JavaScript in place of Python. I use JavaScript a lot for browser stuff but can JavaScript be used for the random command-line script
by kens 4y ago
The article mentions using JavaScript in place of Python. I use JavaScript a lot for browser stuff but can JavaScript be used for the random command-line scripts that I implement in Python? (Genuine question, not rhetorical.)
- fndex 4y agoYep.
- brnewd 4y agoI use Node.js/TypeScript for all my scripting needs. Together with pm2 which can auto-generate a systemd service if it needs to run as a service on boot. Coming back to a strongly typed project / script is actually really beneficial to refactor or extend.
- baq 4y agoNode is an interpreter just like Python, gives access to OS features like sockets, file systems and processes, so yes, you can. However I’d rather not if you value your sanity and want to use typescript, because then you introduce packages and compilers and the whole npm ecosystem which makes building C++ look easy and sane.
- pjmlp 4y agoIt is the first time I see gyp being called easy and sane.
- baq 4y agoTo build what I’m currently working on it is required to use docker, pnpm, npm, nx, tsc, corepack and nvm. I think. Not sure at all. I haven’t built some parts of the project. There’s more involved to run most tests. Something went off the rails at some point.
- deleted 4y ago[deleted]
- Atlas22 4y agoNode.js can be used for command line scripts. Its chromes v8 JavaScript engine strapped to an API for interacting at the system level.