Skip to content

Boilerplate for creating a TypeScript program with Bun.

Notifications You must be signed in to change notification settings

acfatah/bun-templates

Repository files navigation

Bun TypeScript Boilerplates / Templates

bun.sh Code Style GitHub last commit (by committer)

This repository hold boilerplates or templates for creating a TypeScript program with Bun.

Features

  • Preinstalled with eslint and @antfu/eslint-config.
  • Predefined common scripts like format, lint, etc.
  • Predifined common vscode settings and extensions.

Usage

To create a project using this template, make a new directory with your chosen project name, navigate into it, then run the following command:

bunx --bun tiged acfatah/bun-templates/templates/starter

Afterwards, you can update and install the latest dependencies with:

bun update

Look under the templates directory to see the other available templates. Replace /starter with the template that you want to use.

Common Files

Common files that are similar across templates are stored under templates/_. Optionally you may include them with the same command as above.

Example to copy build.ts instead of the entire scripts directory:

bunx --bun get-file acfatah/bun-templates/templates/_/scripts/build.ts

Archived Templates

Archived templates are stored under archived.

You can still use them the same way as the active templates:

bunx --bun tiged acfatah/bun-templates/archived/clack

Post-install Scripts

By default, bun will block all post-install scripts, including simple-git-hooks.

To list all blocked scripts, you can run:

bun pm unstrusted

To execute them, run

bun pm trust --all

Alternatively, you can specify each package name individually.

About

Boilerplate for creating a TypeScript program with Bun.

Resources

Stars

Watchers

Forks

Languages