﻿---
title: Streamline Package Development with Bun Link
date: 2025-12-02
tags:
  - Bun
excerpt: "Use bun link to debug local libraries and blog themes without repeatedly publishing and reinstalling packages."
updated: 2026-07-08 07:21:50
lang: en
i18n:
  cn: /bun_link
  translation: 2
---

## Bun Link

1. Run `{shell} bun link` in the library project directory to register the library as a globally linkable package.
2. In the project that needs to use the library, run `{shell} bun link {package-name}` to link that local library into the project.
3. After that, the project can use the library directly, and changes made inside the library project will be reflected in the project in real time.

```console
$ cd ~/Projects/hexo-dev/hexo-shiki-highlight
$ bun link
$ bun link v1.3.3 (274e01c7)
Success! Registered "hexo-shiki-highlight"

To use hexo-shiki-highlight in a project, run:
  bun link hexo-shiki-highlight

Or add it in dependencies in your package.json file:
  "hexo-shiki-highlight": "link:hexo-shiki-highlight"
$ cd ~/Projects/vluv
$ bun link hexo-shiki-highlight
bun link v1.3.3 (274e01c7)

installed hexo-shiki-highlight@link:hexo-shiki-highlight

1 package installed [47.00ms]
```

[^1]: Link local package for development [bun link - Bun](https://bun.com/docs/pm/cli/link)
