nodecmd

Accept input, then print the output through a given JS function.

Usage no npm install needed!

<script type="module">
  import nodecmd from 'https://cdn.skypack.dev/nodecmd';
</script>

README

nodecmd

Auto buffer piped/streamed input, and then evaluate it using the given JS function.

Examples

# encode a file as base64
$ < somefile nodecmd btoa

# decode the clipboard contents
$ pbpaste | nodecmd decodeURIComponent

Notes

This is doing this all in memory, so be aware that it will have trouble with large inputs.

License

MIT