Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

writeBunScriptBin - Create Bun $ Shell Scripts

writeBunScriptBin is useful for creating once off $ Shell scripts, in a similar manner to writeShellScriptBin in nixpkgs.

Example

An example bun script for printing "Hello World" might look like:

writeBunScriptBin {
  name = "hello-world";
  text = ''
    import { $ } from "bun";

    await $`echo "Hello World!"`;
  '';
};

Arguments

The full list of accepted arguments is:

ArgumentPurpose
nameThe name to give the binary of the script
textTextual contents of the script