@jiangweiye/cloudflare-wasm-yaml
v0.0.7
Published
YAML parser for javascript
Downloads
8
Readme
cloudflare-wasm
Using Wasm in CloudFlare
Install
with pnpm
pnpm add @jiangweiye/cloudflare-wasm-yaml
with npm
npm install @jiangweiye/cloudflare-wasm-yaml
with yarn
yarn add @jiangweiye/cloudflare-wasm-yaml
Use
import { dump, load } from '@jiangweiye/cloudflare-wasm-yaml';
export default {
async fetch(request: Request, env: Env): Promise<Response> {
const data = load('name: Cloudflare Workers\n');
data.set('name', 'Cloudflare Workers');
const output = dump(data);
return new Response(output, {
headers: { 'content-type': 'text/plain' }
});
}
};