zephraph / deno.run

A tiny Deno development sandbox for quickly building small CLI utilities

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deno.run

A tiny Deno development sandbox for quickly building small CLI utilities.

Instructions

  • Clone the repo
  • Install Deno
  • 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

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

Reformat input

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

Filter by extension

ls | js ".endsWith('.ts')"
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.

"Say hello!" | chat-gpt
Hello! How may I assist you today?

About

A tiny Deno development sandbox for quickly building small CLI utilities

License:MIT License


Languages

Language:TypeScript 88.9%Language:Shell 11.1%