Bun Lifecycle Scripts

How Bun handles package lifecycle scripts securely

9 stars 1 forksOther

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add jarle/bun-skills --skill Bun Lifecycle scripts
Manual install
git clone --depth 1 https://github.com/jarle/bun-skills.git /tmp/bun-skills
mkdir -p ~/.claude/skills
cp -r /tmp/bun-skills/skills/bun-pm-lifecycle ~/.claude/skills/Bun-Lifecycle-scripts

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Lifecycle scripts

> How Bun handles package lifecycle scripts securely

Packages on `npm` can define *lifecycle scripts* in their `package.json`. Some of the most common are below, but there are [many others](https://docs.npmjs.com/cli/v10/using-npm/scripts).

* `preinstall`: Runs before the package is installed
* `postinstall`: Runs after the package is installed
* `preuninstall`: Runs before the package is uninstalled
* `prepublishOnly`: Runs before the package is published

These scripts are arbitrary shell commands that the package manager is expected to read and execute at the appropriate time. But executing arbitrary scripts represents a potential security risk, so—unlike other `npm` clients—Bun does not execute arbitrary lifecycle scripts by default.

***

## `postinstall`

The `postinstall` script is particularly important. It's widely used to build or install platform-specific binaries for packages that are implemented as [native Node.js add-ons](https://nodejs.org/api/addons.html). For example, `node-sass` is a popular package that uses `postinstall` to build a native binary for Sass.

```json package.json icon="file-json" theme={"theme":{"light":"github-light","dark":"dracula"}}
{
  "name": "my-app",
  "version": "1.0.0",
  "dependencies": {
    "node-sass": "^6.0.1"
  }
}
```

***

## `trustedDependencies`
Read the full skill on GitHub

Details

Skill name
Bun Lifecycle scripts
Path
skills/bun-pm-lifecycle/SKILL.md
License
MIT
Repo updated
24 February 2026

FAQ

What does the Bun Lifecycle Scripts skill do?

How Bun handles package lifecycle scripts securely

How do I install the Bun Lifecycle Scripts skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add jarle/bun-skills --skill Bun Lifecycle scripts. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Bun Lifecycle Scripts popular?

It lives in jarle/bun-skills, which has 9 GitHub stars and 1 forks.

Related skills

Browse the most popular Claude skills, all other skills, or write your own with the skills generator.