An Agnostic Implementation for IO Operations
null
.import { wrap } from "vixeny";
wrap()()
.customPetition({
path: "/getPackage",
f: async ({ io }) => {
const file = await io.textOf("./package.json");
return new Response(file, {
status: file ? 200 : 404,
});
},
});
import { wrap } from "vixeny";
wrap()()
.customPetition({
path: "/write",
f: async ({ io }) => {
// Returns boolean
const wasWritten = await io.writeText("./file")("hello world!");
return new Response(null, {
status: wasWritten ? 200 : 400,
});
},
});
If crypto
with at least a globalKey
is present.