Javascript login shell |
||
|
Posted by: stak I was playing around with node.js this weekend, and I realized that it's not that hard to end up with a Javascript-based login shell. A basic one can be obtained by simply installing node.js and ShellJS on top of it. Add CoffeeScript to get a slightly less verbose syntax. For example:
kats@kgupta-pc shelljs$ coffee coffee> require './global.js' {} coffee> ls() [ 'LICENSE', 'README.md', 'bin', 'global.js', 'make.js', 'package.json', 'scripts', 'shell.js', 'src', 'test' ] coffee> cat 'global.js' 'var shell = require(\'./shell.js\');\nfor (var cmd in shell)\n global[cmd] = shell[cmd];\n' coffee> cp('global.js', 'foo.tmp') undefined coffee> cat 'foo.tmp' 'var shell = require(\'./shell.js\');\nfor (var cmd in shell)\n global[cmd] = shell[cmd];\n' coffee> rm 'foo.tmp' undefined coffee>
|
|
(c) Kartikaya Gupta, 2004-2024. User comments owned by their respective posters. All rights reserved. You are accessing this website via IPv4. Consider upgrading to IPv6! |
If you were to work on this project I'd certainly use it, I'd be more than happy to do some testing too!
Neil