Bun Lifecycle Scripts
How Bun handles package lifecycle scripts securely
Install
npx skills add jarle/bun-skills --skill Bun Lifecycle scriptsgit 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-scriptsPersonal 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`Details
- Skill name
Bun Lifecycle scripts- Repository
- jarle/bun-skills
- 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
Bun Archive
9jarle/bun-skills
Create and extract tar archives with Bun's fast native implementation
Bun Auto Install
9jarle/bun-skills
Bun's automatic package installation feature for standalone script execution
Bun Bun Add
9jarle/bun-skills
Add packages to your project with Bun's fast package manager
Bun Overrides and Resolutions
9jarle/bun-skills
Control metadependency versions with npm overrides and Yarn resolutions
Bun JSX
9jarle/bun-skills
Built-in JSX and TSX support in Bun with configurable transpilation options
Bun S3
9jarle/bun-skills
Bun provides fast, native bindings for interacting with S3-compatible object storage services.
Browse the most popular Claude skills, all other skills, or write your own with the skills generator.