4 ms·
Really loving Bun these days. Was really pleasantly surprised using their shell scripting API in typescript - single file, shebang line, straightforward DSL, su
by dsabanin 1y ago
Really loving Bun these days. Was really pleasantly surprised using their shell scripting API in typescript - single file, shebang line, straightforward DSL, support for piping data here and there.
Really, really nice and ergonomic. Made a few utility scripts today and enjoyed it much better than bash.
https://bun.com/docs/runtime/shell https://bun.com/docs/runtime/shell
- eknkc 1y agoIt is also my first choice now. Especially due to built in SQLite support. Also recently needed to write a simple script to dump some data to S3. Found out that bun has built in s3 client too...
- Ciantic 1y agoI use Bun for many package.json projects, but for shell scripting specifically, I find that Deno is a better choice because you can use dependencies with just import statements via NPM or JSR. #!/usr/bin/env -S deno run import { z } from "npm:zod"; import { Webview } from "jsr:@webview/webview";
- lioeters 1y agoI just learned that Bun supports "autoimports" similar to the above. > If no node_modules directory is found in the working directory or higher, Bun will abandon Node.js-style module resolution in favor of the Bun module resolution algorithm. > Under Bun-style module resolution, all imported packages are auto-installed on the fly into a global module cache during execution (the same cache used by bun install). https://bun.sh/docs/runtime/autoimport https://bun.sh/docs/runtime/autoimport