Created
December 22, 2017 14:48
-
-
Save minodisk/cbb2f305884b82d5b22aaa9fc1e3239d to your computer and use it in GitHub Desktop.
Usage of @minodisk/medkit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Client from "@minodisk/medkit"; | |
(async () => { | |
const client = new Client(); | |
const postId = await client.createPost( | |
"<h3>Title</h3><h4>Subtitle</h4><p>Text</p>", | |
); | |
const html = await client.readPost(postId); // -> "<h1>Title</h1><h2>Subtitle</h2><p>Text</p>" or "<h3>Title</h3><h4>Subtitle</h4><p>Text</p>" | |
await client.updatePost( | |
postId, | |
"<h3>Title</h3><h4>Subtitle</h4><p>Modified</p>", | |
); | |
await client.destroyPost(postId); | |
await client.close(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment