Awkward – A Node.js-based terminal emulator
1–10 of 64 posts
Re: Awkward – A Node.js-based terminal emulator
#2Re: Awkward – A Node.js-based terminal emulator
#3It'd be better - and FAR more work - to make an object pipeline based powershell equivalent for Nix, based on JSON. You could write cmdlets in any language that outputs JSON and do better at this project's goal of avoiding scraping.
ps node | select pid
instead of: ps().find(function(line){ return line[3] === 'node' })[0]
Since the fields have keys, you avoid magic numbers and the code's easier to read.(you could of course alias those to make 'pidof node' like Linux distros do)
The end result would be much better than Powershell, since it would use JSON and not be tied to .net languages.
Re: Awkward – A Node.js-based terminal emulator
#4Re: Awkward – A Node.js-based terminal emulator
#5Re: Awkward – A Node.js-based terminal emulator
#6This is good, but the data structures - eg arrays of arrays - don't really match the underlying data. Imagine what 'ip addr' or 'ifconfig' would look like - they output paragraphs rather than lines, so scraping lines wouldn't produce good output. It'd be better - and FAR more work - to make an object pipeline based powershell equivalent for Nix, based on JSON. You could write cmdlets in any language that outputs JSON…
Re: Awkward – A Node.js-based terminal emulator
#7This is great! I'll just let this evolve a bit, and wait for broader community support, and then I'll happily replace bash by this shell!
Re: Awkward – A Node.js-based terminal emulator
#8Like. But PowerShell still rules. Wish it was oss and x-plat
Re: Awkward – A Node.js-based terminal emulator
#9Neat hack! I like the idea. Initially when I read the title I thought it would be yet another 'make my shell behave more like my preferred language' type of project. Those while fun to code and play with aren't really useful in the long run. This though might just be useful.
Re: Awkward – A Node.js-based terminal emulator
#10 ps | awk 'NR>1{ print $1, $4}'
I'll give that the syntax of these shell programs take some work to understand but they're hard to beat for the purpose they serve.If you're parsing plenty of JSON these days I find 'jq' indispensable. It's basically awk/sed for JSON.
I would just be sure to study those programs as they took quite a bit of effort to make them fast. And there are plenty of alternatives with extended syntax and features.
Best of luck.