skills/bun-guides-install-azure-artifacts/SKILL.md
Using bun install with an Azure Artifacts npm registry
npx skillsauth add jarle/bun-skills Bun Using bun install with an Azure Artifacts npm registryInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Azure Artifacts is a package management system for Azure DevOps. It allows you to host your own private npm registry, npm packages, and other types of packages as well.
To use it with bun install, add a bunfig.toml file to your project with the following contents. Make sure to replace my-azure-artifacts-user with your Azure Artifacts username, such as jarred1234.
[install.registry]
url = "https://pkgs.dev.azure.com/my-azure-artifacts-user/_packaging/my-azure-artifacts-user/npm/registry"
username = "my-azure-artifacts-user"
# You can use an environment variable here
password = "$NPM_PASSWORD"
Then assign your Azure Personal Access Token to the NPM_PASSWORD environment variable. Bun automatically reads .env files, so create a file called .env in your project root. There is no need to base-64 encode this token! Bun will do this for you.
NPM_PASSWORD=<paste token here>
To configure Azure Artifacts without bunfig.toml, you can set the NPM_CONFIG_REGISTRY environment variable. The URL should include :username and :_password as query parameters. Replace <USERNAME> and <PASSWORD> with the appropriate values.
NPM_CONFIG_REGISTRY=https://pkgs.dev.azure.com/my-azure-artifacts-user/_packaging/my-azure-artifacts-user/npm/registry/:username=<USERNAME>:_password=<PASSWORD>
In Azure Artifact's instructions for .npmrc, they say to base64 encode the password. Do not do this for bun install. Bun will automatically base64 encode the password for you if needed.
<Note>Tip — If it ends with ==, it probably is base64 encoded.</Note>
To decode a base64-encoded password, open your browser console and run:
atob("<base64-encoded password>");
Alternatively, use the base64 command line tool, but doing so means it may be saved in your terminal history which is not recommended:
echo "base64-encoded-password" | base64 --decode
development
Using TypeScript with Bun, including type definitions and compiler options
development
Learn how to write tests using Bun's Jest-compatible API with support for async tests, timeouts, and various test modifiers
testing
Learn how to use snapshot testing in Bun to save and compare output between test runs
testing
Learn about Bun test's runtime integration, environment variables, timeouts, and error handling