Cash: Javascript for cross-platform Unix Shell

Source: Internet
Author: User

Cash: Javascript for cross-platform Unix Shell

 


 

Cash is a cross-platform Unix shell that is purely implemented by ES6 (Javascript). It can be used in windows and has been subjected to over 200 strict and comprehensive unit tests.

Introduction

Cash's github address isHereYou can think of Cygwin, but Cash also has other features:

1. Non-local Compilation

2. There is no trouble with DLL files

3. Any terminal is available

4. Only Cygwin is about 15 minutes long.

Cash actually has a special significance. It replaces the ">" sign with "$", which is the currency symbol, representing the concept of "answering questions.

> cash$

 

 

 

Of course, Cash looks like bash, but it does.

Do you want to use it? What you need to do is:

> npm install cash -g> cash$

 

Now let's try "combining Chinese and Western" to mix Windows and Unix commands:

$ ipconfig | grep IPv4 | sortIPv4 Address. . . . . . . . . . . :10.10.40.50IPv4 Address. . . . . . . . . . . :192.168.100.11$

 

Click here for details

However, if you want to enable Cash separately, you can set it to take effect globally:

> npm install cash-global -g> ls –lah

 

Click here for details

Of course, if you only want some commands, you can:

> npm install cash-ls -g> npm install cash-grep –g

 

Click here for details

What's amazing is that if you want to use it during programming, you can call it like this:

const $ = require('cash');const out = $.ls('.', {l: true});

 

Isn't it convenient enough? The following is the example:

const out = $('ls -lah');

Of course, if you want to have a better programming experience for Unix commands, see Shell. JS.

Security and experience

Because Shell. although JS and the Cash mentioned in this article provide you with a Unix shell experience, it will be better in terms of security and some details, because these Unix commands are simulated by the javascript library, they return javascript objects.

Let's take a look at the following:

Cash implementation:

$('ls');// 'node_modules\n'$('echofoo > foo.txt');

 

Implementation of Shell. JS:

ls();// ['node_modules'];echo('foo').to('foo.txt');

 

By the way, I have another project named Vorpal written in Node. js.

Cash command

Currently, cash supports the following commands:

Alias
Cat
Cd
Cp
Echo
Grep
Kill
Less
Ls
Mkdir
Mv
Pwd
Rm
Sort
Touch
Unalias

 

Want me to develop more commands? Please vote here. Of course, I also welcome everyone to contribute code.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.