new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Bun · Package manager · all subjects

add: source types

6 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Add tarball as dependency syntax

To add a tarball URL as a dependency, use the syntax bun add <package-name>@<tarball-url>. For example: bun add zod@https://registry.npmjs.org/zod/-/zod-3.21.4.tgz. The command downloads, extracts, and installs the tarball into the node_modules directory.

Tarball dependency in package.json format

When a tarball is added as a dependency, package.json records it with the full tarball URL as the version value. For example: "zod": "https://registry.npmjs.org/zod/-/zod-3.21.4.tgz".

Importing packages installed from tarball

Packages installed from tarball URLs can be imported using standard JavaScript import syntax, as if they were installed from a registry. For example: import { z } from "zod";

Non-npm dependencies installation formats

Bun supports installing dependencies from Git, GitHub, and local or remotely-hosted tarballs. Formats include: 'git+https://github.com/user/repo.git', 'git+ssh://github.com/user/repo.git#version', 'git@github.com:user/repo.git', 'github:user/repo', 'https://registry.npmjs.org/package/-/package-version.tgz', and 'npm:@scope/package'.

Git dependencies syntax

Add a dependency from a public or private git repository using `bun add git@github.com:owner/repo.git`. Bun supports protocols including `github`, `git`, `git+ssh`, and `git+https`. Examples: `bun add git@github.com:moment/moment.git`, `bun add git+https://github.com/iamkun/dayjs.git`, `bun add git+ssh://github.com/lodash/lodash.git#4.17.21`, `bun add github:colinhacks/zod`. To install private repositories, the system needs appropriate SSH credentials.

Tarball dependencies syntax

Add a package from a publicly hosted `.tgz` file using `bun add <package-name>@<tarball-url>`. Example: `bun add zod@https://registry.npmjs.org/zod/-/zod-3.21.4.tgz`. Bun downloads and installs from the tarball URL rather than the package registry. A tarball URL can carry credentials as `https://user:password@example.com/zod-3.21.4.tgz`; Bun sends them as an `Authorization: Basic` header and requests the URL without them, similar to npm. The URL with credentials is written to both `package.json` and the lockfile.

Give your agent this brain