Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zephraph/deno.run

A tiny Deno development sandbox for quickly building small CLI utilities
https://github.com/zephraph/deno.run

cli deno tooling utility

Last synced: 8 days ago
JSON representation

A tiny Deno development sandbox for quickly building small CLI utilities

Awesome Lists containing this project

README

        

# Deno.run

A tiny [Deno](https://deno.land/) development sandbox for quickly building small CLI utilities.

## Instructions

- Clone the repo
- [Install Deno](https://deno.land/#installation)
- Add the `.run` directory to your path
- Run `dr`
- Make cool things!

## Included scripts

## `dr`

Adds bash script runners for every `.ts` file in the root of the repo to `.run` for quick execution.
You can add permissions for individual scripts by adding a comment with `//` at the beginning of the file
and including the exact flags you'd like to pass to deno like `--allow-read`

## `js`

Handle piped text with JavaScript!

### Reverse the text of every piped line

```bash
ls | js ".split('').reverse().join('')"
```

### Reformat input

```bash
ls | js "x => `- \${x}`"
```

### Filter by extension

```bash
ls | js ".endsWith('.ts')"
```

```bash
ls | js "x => !x.endsWith('.ts')"
```

## chat-gpt

Takes a piped string and shuttles it off to OpenAI's chat completion API with a prompt to return results as markdown. Results
are printed to stdout.

```bash
"Say hello!" | chat-gpt
```

```
Hello! How may I assist you today?
```