mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 05:16:28 +03:00
run prettier formatter on some readme files
This commit is contained in:
@@ -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.
|
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:
|
To use it locally, first install the dependencies and compile the TypeScript code to JavaScript:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cd typescript
|
cd typescript
|
||||||
npm install
|
npm install
|
||||||
@@ -32,18 +33,20 @@ import { C } from "@deltachat/jsonrpc-client";
|
|||||||
|
|
||||||
const dc = await startDeltaChat("deltachat-data");
|
const dc = await startDeltaChat("deltachat-data");
|
||||||
console.log(await dc.rpc.getSystemInfo());
|
console.log(await dc.rpc.getSystemInfo());
|
||||||
const accounts = await dc.rpc.getAllAccounts()
|
const accounts = await dc.rpc.getAllAccounts();
|
||||||
console.log('accounts', accounts)
|
console.log("accounts", accounts);
|
||||||
dc.close()
|
dc.close();
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Generate TypeScript/JavaScript documentation
|
##### Generate TypeScript/JavaScript documentation
|
||||||
|
|
||||||
A script is included to build autogenerated documentation, which includes all RPC methods:
|
A script is included to build autogenerated documentation, which includes all RPC methods:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cd typescript
|
cd typescript
|
||||||
npm run docs
|
npm run docs
|
||||||
```
|
```
|
||||||
|
|
||||||
Then open the [`typescript/docs`](typescript/docs) folder in a web browser.
|
Then open the [`typescript/docs`](typescript/docs) folder in a web browser.
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|||||||
@@ -18,11 +18,11 @@ import { startDeltaChat } from "@deltachat/stdio-rpc-server";
|
|||||||
import { C } from "@deltachat/jsonrpc-client";
|
import { C } from "@deltachat/jsonrpc-client";
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
const dc = await startDeltaChat("deltachat-data");
|
const dc = await startDeltaChat("deltachat-data");
|
||||||
console.log(await dc.rpc.getSystemInfo());
|
console.log(await dc.rpc.getSystemInfo());
|
||||||
dc.close()
|
dc.close();
|
||||||
}
|
}
|
||||||
main()
|
main();
|
||||||
```
|
```
|
||||||
|
|
||||||
For a more complete example refer to https://github.com/deltachat-bot/echo/tree/master/nodejs_stdio_jsonrpc.
|
For a more complete example refer to https://github.com/deltachat-bot/echo/tree/master/nodejs_stdio_jsonrpc.
|
||||||
|
|||||||
Reference in New Issue
Block a user