# @lrpc/client

> [![Build Status](https://travis-ci.org/roziscoding/lrpc.svg?branch=master)](https://travis-ci.org/roziscoding/lrpc) [![License](https://badgen.net/github/license/roziscoding/lrpc)](./LICENSE) [![Library minified size](https://badgen.net/bundlephobia/min/@

Latest version **0.2.0** (published 2021-03-21) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install @lrpc/client
pnpm add @lrpc/client
yarn add @lrpc/client
bun add @lrpc/client
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2021-03-21 |
| First published | 2021-03-20 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 45.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Rogério Munhoz |
| Maintainers | rjmunhoz |
| Keywords | typescript, boilerplate, library |

## Links

- npm: https://www.npmjs.com/package/@lrpc/client
- Repository: https://github.com/roziscoding/lrpc
- Homepage: https://github.com/roziscoding/lrpc#readme
- Issues: https://github.com/roziscoding/lrpc/issues
- npm.io page: https://npm.io/package/@lrpc/client

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2021-03-21
- 0.1.0 — 2021-03-21
- 0.0.1 — 2021-03-20

## README

# lRPC client

[![Build Status](https://travis-ci.org/roziscoding/lrpc.svg?branch=master)](https://travis-ci.org/roziscoding/lrpc)
[![License](https://badgen.net/github/license/roziscoding/lrpc)](./LICENSE)
[![Library minified size](https://badgen.net/bundlephobia/min/@lrpc/client)](https://bundlephobia.com/result?p=@lrpc/client)
[![Library minified + gzipped size](https://badgen.net/bundlephobia/minzip/@lrpc/client)](https://bundlephobia.com/result?p=@lrpc/client)

## Installation

This library is published in the NPM registry and can be installed using any compatible package manager.

```sh
npm install @lrpc/client --save

# For Yarn, use the command below.
yarn add @lrpc/client
```

### Installation from CDN

This module has an UMD bundle available through JSDelivr and Unpkg CDNs.

```html
<!-- For UNPKG use the code below. -->
<script src="https://unpkg.com/@lrpc/client"></script>

<!-- For JSDelivr use the code below. -->
<script src="https://cdn.jsdelivr.net/npm/@lrpc/client"></script>

<script>
  // UMD module is exposed through the "lrpc" global variable.
  console.log(lrpc);
</script>
```

## Usage

This package exports an async function `createClient`, which accepts the URL of your API and provides you with a javascript Proxy object that will convert your function calls into RPCs.

```typescript
async main () {
  const client = await createClient('http://localhost:3000') // This calls a handshake function on the server

  const { greeting } = client.greet({ name: 'John' }) // 'Hello, John'
}

main()
  .catch(console.error)
```

## License

Released under [MIT License](./LICENSE).

---
_Source: https://npm.io/package/@lrpc/client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
