Skip to content

Instantly share code, notes, and snippets.

@minodisk
Created December 22, 2017 14:48
Show Gist options
  • Save minodisk/cbb2f305884b82d5b22aaa9fc1e3239d to your computer and use it in GitHub Desktop.
Save minodisk/cbb2f305884b82d5b22aaa9fc1e3239d to your computer and use it in GitHub Desktop.
Usage of @minodisk/medkit
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