aboutsummaryrefslogtreecommitdiff
path: root/docs/guides/install
diff options
context:
space:
mode:
authorGravatar Colin McDonnell <colinmcd94@gmail.com> 2023-09-12 21:51:49 -0700
committerGravatar GitHub <noreply@github.com> 2023-09-12 21:51:49 -0700
commit18b521d9b875f4514e413dbe9b614309fd1618aa (patch)
treea5c48717836c21f0e837dfe11dbc6ced3c6e7d68 /docs/guides/install
parent534fd30dbd297d69b8680df66019d865fdf54e39 (diff)
downloadbun-18b521d9b875f4514e413dbe9b614309fd1618aa.tar.gz
bun-18b521d9b875f4514e413dbe9b614309fd1618aa.tar.zst
bun-18b521d9b875f4514e413dbe9b614309fd1618aa.zip
Various docs (#5201)
* Updates * Improve jest guide * Improve
Diffstat (limited to 'docs/guides/install')
-rw-r--r--docs/guides/install/trusted.md29
1 files changed, 29 insertions, 0 deletions
diff --git a/docs/guides/install/trusted.md b/docs/guides/install/trusted.md
new file mode 100644
index 000000000..3dc14aa94
--- /dev/null
+++ b/docs/guides/install/trusted.md
@@ -0,0 +1,29 @@
+---
+name: Add a trusted dependency
+---
+
+Unlike other npm clients, Bun does not execute arbitrary lifecycle scripts for installed dependencies, such as `postinstall` and `node-gyp` builds. These scripts represent a potential security risk, as they can execute arbitrary code on your machine.
+
+---
+
+To tell Bun to allow lifecycle scripts for a particular package, add the package to `trustedDependencies` in your package.json.
+
+```json-diff
+ {
+ "name": "my-app",
+ "version": "1.0.0",
++ "trustedDependencies": ["my-trusted-package"]
+ }
+```
+
+<!-- Bun maintains an allow-list of popular packages containing `postinstall` scripts that are known to be safe. To run lifecycle scripts for packages that aren't on this list, add the package to `trustedDependencies` in your package.json. -->
+
+---
+
+Note that this only allows lifecycle scripts for the specific package listed in `trustedDependencies`, _not_ the dependencies of that dependency!
+
+Soon, Bun will include a built-in allow-list that automatically allows lifecycle scripts to be run by popular packages that are known to be safe. This is still under development.
+
+---
+
+See [Docs > Package manager > Trusted dependencies](/docs/cli/install#trusted-dependencies) for complete documentation of trusted dependencies.