npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cash

v0.8.0

Published

Cross-platform Linux commands in pure ES6.

Downloads

11,331

Readme

Cross-platform Linux commands in pure ES6

Build Status Windows Build Status Coverage Status Gitter XO code style

Cash is a cross-platform implementation of Unix shell commands written in pure ES6.

Huh? Okay - think Cygwin, except:

  • No native compiling
  • No ugly DLLs
  • Works in any terminal
  • 1/15th of the size
  • Just:
> npm install cash -g
> cash
$

Woah.

Yeah. But it gets better.

Let's mix some Windows & Unix commands together:

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

Learn more

But I don't want to type "cash"

No problem. Let's make all commands global on your system:

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

Learn more

Nice, but I only want certain commands

You're covered!

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

Learn more

Wow. But I want this programmatically!

Again, you're in business:

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

Not terse enough? How about this:

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

Not :sunglasses: enough? Try this:

require('cash') `
  cp -R ./src ./dest
  ls | grep *-spec.js | cat
  rm ./specResults.html 
`;

For even better programmatic Unix commands, check out Shell.JS.

Learn more

Isn't this impossible to do in Node?

It was, before Vorpal.

Made with ❤ by dthree.

Love it? Cash is brand new! Give it a :star: or a tweet to help spread the word!

Contents

Introduction

Cash is a project working on a cross-platform implementation of the most used Unix-based commands in pure JavaScript and with no external dependencies.

The goal of Cash is to open up these commands to the massive JavaScript community for the first time, and to provide a cleaner, simpler and flexible alternative to applications like Cygwin for those wanting the Linux feel on Windows.

Cash was built with strict attention to nearly exact implementations and excellent test coverage of over 200 unit tests.

Supported commands

The following commands are currently implemented:

  • alias
  • cat
  • clear
  • cd
  • cp
  • echo
  • export
  • false
  • grep
  • head
  • kill
  • less
  • ls
  • mkdir
  • mv
  • pwd
  • rm
  • sort
  • source
  • tail
  • touch
  • true
  • unalias

Want more commands?

Contributing

I am currently looking for someone with experience in building Windows installers (.msi) to bundle Cash and its individual components into a self-contained wrapper. If you would like to help with this, send me a ping.

Awesome contributors

  • @nfischer: Added source, export, true and false commands, among several other contributions.
  • @safinn: Added clear and tail commands.
  • @legien: Added head command.
  • @cspotcode: Implemented template literal execution.

FAQ

Why Cash?

In its very essence, Cash replaces the Windows CLI prompt (>) with the Unix one ($), the dollar symbol.

Cash was most fitting in this sense:

Ask and ye shall receive

> cash
$

Cash is also a play on the word bash, and is actually[1] a recursive acronym for Cash Shell.

Shout out to @aseemk for donating the name.

Doesn't Shell.js do this?

No.

For those who don't know, Shell.JS is an awesome Node package that implements UNIX shell commands programatically in JavaScript. Check it out - really. While Shell.JS was tremendously helpful in figuring out how to accomplish Cash, the two do not really conflict.

Shell.JS gives the feel of UNIX commands in a code environment, but aims to implement the commands in a way that makes sense for a JavaScript library. This means that many commands return JavaScript objects, and some of the rougher and more dangerous edges of bash have been softened a bit.

For example, with cash:

$('ls'); // 'node_modules\n'

$('echo foo > foo.txt');

With Shell.JS:

ls(); // ['node_modules'];

echo('foo').to('foo.txt');

License

MIT © David Caccavella