# remote-variable

> Work with variable from another worker, process or javascript environment as with your variable.

Latest version **0.1.0** (published 2022-06-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install remote-variable
pnpm add remote-variable
yarn add remote-variable
bun add remote-variable
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2022-06-19 |
| First published | 2022-06-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 14.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Filip Paulů |
| Maintainers | ing-fenix |
| Keywords | remote, variable, TypeScript |

## Links

- npm: https://www.npmjs.com/package/remote-variable
- Repository: https://github.com/ingSlonik/remote-variable
- Homepage: https://github.com/ingSlonik/remote-variable#readme
- Issues: https://github.com/ingSlonik/remote-variable/issues
- npm.io page: https://npm.io/package/remote-variable

## Dependencies (1)

- [deasync](https://npm.io/package/deasync.md) ^0.1.26

## 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.1.0 (latest) — 2022-06-19

## README

# Remote variable

Work with variable from another worker, process or javascript environment as with your variable.

## Usage

```js
import { onRemoteVariable, connectRemoteVariable } from "remote-variable";

onRemoteVariable(postMessage, onMessage, (id, remoteVariable) => {
    if (id === "document") document = remoteVariable as Document;
});
// or
const [document] = await connectRemoteVariable<Document>("document", postMessage, onMessage);

// now you can draw to remote canvas from nodejs
const canvas = document.getElementById("my-canvas");
...
```

```js
import { accessVariables } from "remote-variable/client";

accessVariables("document", document, postMessage, onMessage);
```
## Examples

    $ npm run examples -- examples/canvas.ts

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