typedrest 0.3.8-beta0019-df8934d
Install from the command line:
Learn more about npm packages
$ npm install @typedrest/typedrest@0.3.8-beta0019-df8934d
Install via package.json:
"@typedrest/typedrest": "0.3.8-beta0019-df8934d"
About this version
TypedRest helps you build type-safe, fluent-style REST API clients. Common REST patterns such as collections are represented as classes, allowing you to write more idiomatic code.
const client = new MyClient(new URL("http://example.com/"));
// GET /contacts
const contactList: Contact[] = await client.contacts.readAll();
// POST /contacts -> Location: /contacts/1337
const smith: ContactEndpoint = await client.contacts.create({name: "Smith"});
//const smith: ContactEndpoint = client.contacts.get("1337");
// GET /contacts/1337
const contact: Contact = await smith.read();
// PUT /contacts/1337/note
await smith.note.set({content: "some note"});
// GET /contacts/1337/note
const note: Note = await smith.note.read();
// DELETE /contacts/1337
await smith.delete();
Read a more detailed Introduction to TypedRest or jump right in with the Getting started guide.
Assets
- typedrest-0.3.8-beta0019-df8934d.tgz
Download activity
- Total downloads 0
- Last 30 days 0
- Last week 0
- Today 0