Gleam bindings to the Bun runtime API's https://hex.pm/packages/bungibindies
Find a file
MLC Bloeiman 048e98253a
All checks were successful
Checks / check-and-test (push) Successful in 13s
Add a bunfig.toml file.
2025-09-26 20:35:49 +02:00
.forgejo/workflows Rename job from 'test' to 'check-and-test' for clarity in workflow 2025-09-20 02:06:43 +02:00
birdie_snapshots this world would be a better place if I tested BEFORE releases 2025-05-19 17:04:01 +02:00
src Remove main function from code, it was there to test. 2025-09-26 16:32:34 +02:00
test Refactor confirm_test to handle different responses and improve readability 2025-09-20 01:46:19 +02:00
.gitignore Add the stdlib after all for Dynamic's 2024-12-13 00:01:09 +01:00
biome.json Add linter rule to disable useIterableCallbackReturn warning 2025-09-20 02:04:43 +02:00
bun.lock Back to readable lockfile 2025-09-20 01:44:57 +02:00
bunfig.toml Add a bunfig.toml file. 2025-09-26 20:35:49 +02:00
gleam.toml Update repository in gleam.tom 2025-09-26 16:27:28 +02:00
LICENSE Initial commit 2024-12-10 13:56:43 +01:00
manifest.toml Okay let me use this as a git dep for a while now... 2025-05-19 15:54:22 +02:00
mise.toml update gleam version 2025-09-20 01:45:26 +02:00
package.json Add bunfile unlink 2025-01-31 23:15:27 +01:00
PROGRESS.md Add some basic spawn()ing functionality 2025-05-19 01:27:30 +02:00
README.md Fix docs 2025-01-16 18:28:31 +01:00
tsconfig.json Include the Gleam prelude in Typescript, allowing me to return Results 2025-01-22 12:23:40 +01:00

bungibindies

(incomplete) Gleam bindings to the Bun runtime API's.

Package Version Hex Docs

WARNING - INCOMPLETE:

Please note, not everything is implemented as of yet. See the progress section for more information.

gleam add bungibindies@1

This is a little example I borrowed from the tests:

pub fn file_write_test() {
  let data = "Hello world! This file is for testing writing :)"
  let file = bun.file("./test/testfiles/writing.txt")
  use _ <- promise.await({ file |> bun.write(data) })
  // If `file_read_test()` fails, this will fail too
  use read_data <- promise.await({ file |> bunfile.text() })
  read_data
  |> string.trim()
  |> should.equal(data)
  |> promise.resolve()
}}

I will be adding more examples to an example folder as I go along.

Further documentation can be found at https://hexdocs.pm/bungibindies.

Development

gleam run   # Run the project
gleam test  # Run the tests

Dependencies

I try to not use anything else than Bun itself, but I do use gleam/javascript to use non-bun-specific JavaScript stuff.