From 1ac520439be33b41e132a9ca8d5edbd4408a290e Mon Sep 17 00:00:00 2001 From: Simon Laux Date: Sat, 2 Nov 2024 14:53:49 +0100 Subject: [PATCH] run prettier formatter on some readme files --- deltachat-jsonrpc/README.md | 9 ++++++--- deltachat-rpc-server/npm-package/README.md | 10 +++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/deltachat-jsonrpc/README.md b/deltachat-jsonrpc/README.md index 6554bcdd8..3e81a7456 100644 --- a/deltachat-jsonrpc/README.md +++ b/deltachat-jsonrpc/README.md @@ -16,6 +16,7 @@ We also include a JavaScript and TypeScript client for the JSON-RPC API. The sou The package includes a JavaScript/TypeScript client which is partially auto-generated through the JSON-RPC library used by this crate ([yerpc](https://github.com/chatmail/yerpc)). Find the source in the [`typescript`](typescript) folder. To use it locally, first install the dependencies and compile the TypeScript code to JavaScript: + ```sh cd typescript npm install @@ -32,18 +33,20 @@ import { C } from "@deltachat/jsonrpc-client"; const dc = await startDeltaChat("deltachat-data"); console.log(await dc.rpc.getSystemInfo()); -const accounts = await dc.rpc.getAllAccounts() -console.log('accounts', accounts) -dc.close() +const accounts = await dc.rpc.getAllAccounts(); +console.log("accounts", accounts); +dc.close(); ``` ##### Generate TypeScript/JavaScript documentation A script is included to build autogenerated documentation, which includes all RPC methods: + ```sh cd typescript npm run docs ``` + Then open the [`typescript/docs`](typescript/docs) folder in a web browser. ## Development diff --git a/deltachat-rpc-server/npm-package/README.md b/deltachat-rpc-server/npm-package/README.md index de892a7a5..28b8201cd 100644 --- a/deltachat-rpc-server/npm-package/README.md +++ b/deltachat-rpc-server/npm-package/README.md @@ -18,11 +18,11 @@ import { startDeltaChat } from "@deltachat/stdio-rpc-server"; import { C } from "@deltachat/jsonrpc-client"; async function main() { - const dc = await startDeltaChat("deltachat-data"); - console.log(await dc.rpc.getSystemInfo()); - dc.close() + const dc = await startDeltaChat("deltachat-data"); + console.log(await dc.rpc.getSystemInfo()); + dc.close(); } -main() +main(); ``` For a more complete example refer to https://github.com/deltachat-bot/echo/tree/master/nodejs_stdio_jsonrpc. @@ -46,7 +46,7 @@ references: When you import this package it searches for the rpc server in the following locations and order: 1. `DELTA_CHAT_RPC_SERVER` environment variable -2. use the PATH when `{takeVersionFromPATH: true}` is supplied in the options. +2. use the PATH when `{takeVersionFromPATH: true}` is supplied in the options. 3. prebuilds in npm packages so by default it uses the prebuilds.