
Product
Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
bun-plugin-yaml
Advanced tools
bun-plugin-yaml
The official YAML plugin for Bun. Adds support for .yml
/.yaml
imports.
bun add bun-plugin-yaml -d
This plugin can be used to support .yaml
loaders in Bun's bundler by passing it into the plugins
array:
import yamlPlugin from "bun-plugin-yaml";
Bun.build({
entrypoints: ["./index.tsx"],
// other config
plugins: [yamlPlugin()],
});
You can now import .yaml
files from your source code:
import data from "./data.yaml";
export function Component() {
return <div>{data.name}</div>;
}
The contents of the .yaml
file will be inlined into your bundle.
To use as a runtime plugin, create a file that registers the plugin:
// yaml.ts
import yamlPlugin from "bun-plugin-yaml";
Bun.plugin(yamlPlugin());
Then preload it in your bunfig.toml
:
preload = ["./yaml.ts"]
By default VSCode/TypeScript will not recognize .yaml
imports. To avoid import errors, add the following to your tsconfig.json
:
{
"compilerOptions": {
"types": [
// other packages, e.g. "bun-types",
+ "bun-plugin-yaml"
]
}
}
$ bun install # project setup
$ bun test # run tests
FAQs
The official YAML plugin for Bun. Adds support for `.yml`/`.yaml` imports.
The npm package bun-plugin-yaml receives a total of 48,880 weekly downloads. As such, bun-plugin-yaml popularity was classified as popular.
We found that bun-plugin-yaml demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.