Template Bun Executable Flowscripter
winget install --id=Flowscripter.template-bun-executable -e
Project template for a cross-platform Bun executable with ffi native library and Bun library dependencies
Template Bun Executable is a project template designed to streamline the creation of cross-platform executables using Bun. This tool simplifies the development process by integrating FFI (Foreign Function Interface) native libraries and managing dependencies efficiently.
Key Features:
- Cross-platform support for building standalone executables
- Integration with Bun runtime, enabling seamless distribution
- Support for FFI native extensions to leverage platform-specific functionality
- Comprehensive dependency management for both Bun and native libraries
Audience & Benefit:
Ideal for developers creating CLI tools or applications requiring native extensions. It provides a unified toolchain for efficient development, testing, and deployment across Windows, Linux, and macOS. With winget support, installation is straightforward, ensuring consistent environments for users globally.
README
template-bun-executable
> Project template for a cross-platform Bun executable with ffi native library > and Bun library dependencies
Template Usage
Create a new Bun project using this as a template:
bun create @flowscripter/template-bun-executable
Binary Executable Usage
NOTE: The binaries are 10's of megabytes in size as the entire Bun runtime is included.
MacOS
Via Homebrew:
brew install flowscripter/tap/template-bun-executable
Linux
In a terminal:
curl -fsSL https://raw.githubusercontent.com/flowscripter/template-bun-executable/main/script/install.sh | sh
Windows
Via Winget:
winget install Flowscripter.template-bun-executable
Manual Install
You can download and extract the binary zip files from the releases page.
Functional Tests
Refer to functional_tests/README.md
Development
Install dependencies:
bun install
Test:
bun test
Run:
bun run index.ts
Compile binary:
bun build index.ts --compile --outfile /tmp/template-bun-executable
NOTE: The following tasks use Deno as it excels at these and Bun does not currently provide such functionality:
Format:
deno fmt
Lint:
deno lint index.ts src/ tests/
Documentation
Overview
Sample mermaid diagram to test rendering in markdown:
classDiagram
Foo <|-- Bar
License
MIT © Flowscripter