sunbeam-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

Sunbeam Deno SDK

Type Validation for Sunbeam Scripts

import * as sunbeam from "https://deno.land/x/sunbeam/mod.ts";

if (Deno.args.length === 0) {
    const manifest: sunbeam.Manifest = {...}
    console.log(manifest);
    Deno.exit(0);
}

const payload: sunbeam.Payload = JSON.parse(Deno.args[0]);

if (payload.command = "show") {
    const list: sunbeam.List = {...}
    console.log(JSON.stringify(list));
}

Helper Functions

import { editor } from "https://deno.land/x/sunbeam/editor.ts";

// ...

if (payload.command === "edit") {
    // open an editor and wait for the user to save and exit
    const edited = await editor(payload.text);
}

Readme

Keywords

none

Package Sidebar

Install

npm i sunbeam-sdk

Weekly Downloads

148

Version

0.3.0

License

MIT

Unpacked Size

10.2 kB

Total Files

20

Last publish

Collaborators

  • pomdtr