Registry / serialization / esbuild-xyaml-plugin

esbuild-xyaml-plugin

JSON →
library0.0.7jsnpmunverified

An esbuild plugin for loading and transforming XYAML files. Version 0.0.7 is the current stable release. This plugin allows importing XYAML files directly into JavaScript/TypeScript bundles built with esbuild. It integrates with esbuild's build pipeline, converting XYAML content to JavaScript objects or strings. As a community-maintained plugin, it fills a niche for projects using XYAML as a data format. Compared to generic YAML loaders, it is purpose-built for the XYAML schema. Release cadence is irregular. The plugin is distributed as a CommonJS module and requires esbuild as a peer dependency.

npm install esbuild-xyaml-plugin
INSTALL
IMPORT
SIG · ESBUILD-XYAML-PLUG
E
esbuild-xyaml-plugin
serializationjavascriptv0.0.7
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const xyamlPlugin = require('esbuild-xyaml-plugin');
import xyamlPlugin from 'esbuild-xyaml-plugin';
The package is CommonJS only; ESM import will fail unless using a bundler that interops.
default
import xyamlPlugin from 'esbuild-xyaml-plugin';
When using a bundler or TypeScript with esModuleInterop, named default import works.

Shows how to use the plugin with esbuild's build API, including loader configuration and plugin registration.

const esbuild = require('esbuild'); const xyamlPlugin = require('esbuild-xyaml-plugin'); esbuild.build({ entryPoints: ['./src/index.js'], bundle: true, outfile: './dist/app/app.js', loader: { '.js': 'jsx', }, sourcemap: true, target: ['chrome58', 'firefox57', 'safari11', 'edge16'], define: { 'process.env.NODE_ENV': '"development"', }, plugins: [xyamlPlugin()], }).catch(() => process.exit(1));
Debug
Known issues
gotchaThe plugin must be invoked as a function (e.g., xyamlPlugin()) to create the plugin object, not passed as a reference.
fix
Call the imported default export: xyamlPlugin()
affects: >=0.0.0
gotchaThe package is CommonJS only; using ESM import without bundler support may fail.
fix
Use require() or configure your bundler to handle CJS interop.
affects: >=0.0.0
breakingNo breaking changes reported for this version.
fix
None.
affects: >=0.0.7
Errors
Common errors & fixes
TypeError: xyamlPlugin is not a function
Importing the default export incorrectly or forgetting to call the plugin factory.
fix
Ensure you import the module correctly and invoke it: const xyamlPlugin = require('esbuild-xyaml-plugin'); ... plugins: [xyamlPlugin()]
Error: Cannot find module 'esbuild'
esbuild is not installed.
fix
Install esbuild: npm install --save-dev esbuild
Upgrade
Version history
0.0.7latest on npm
Audit
Dependencies
esbuildrequiredPeer dependency required to integrate as a plugin.
Agent activity
4 hits · last 30 days
node
2
Bingbot
2
Resources
esbuild-xyaml-plugin — npm install esbuild-xyaml-plugin · libregistry