GreenDelta / olca-ipc.ts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

olca-ipc.ts

This is a TypeScript client for the openLCA IPC API. It supports the JSON-RPC and REST protocol of that API. See also the openLCA IPC documentation and the examples of this repository for more details. There is also a small example that shows the usage of this package in a web-ui available here.

olca-ipc.ts is available as npm package. Alternatively, you can directly import the latest version in your modules when you use Deno:

import * as o from "https://raw.githubusercontent.com/GreenDelta/olca-ipc.ts/main/mod.ts";

const client = o.IpcClient.on(8080);
// ...

Building from source

The schema.ts module is generated from the openLCA schema definitions using the osch tool:

cd olca-schema/osch
# go build  # to compile the osch tool
./osch ts -o path/to/olca-ipc.ts/src/schema.ts
cd path/to/olca-ipc.ts
deno fmt  # format the generated code

Deno is used as development tool. The npm package can be created via dnt with the build_npm.ts script:

deno run --allow-all scripts/build_npm.ts

# publish on npm; make sure to update the version in build_npm.ts
# also, you need to be signed into npmjs.org and verify the update
cd npm
npm publish

About

License:Mozilla Public License 2.0


Languages

Language:TypeScript 100.0%