# melf-sharing

> (A)Synchronous remote references based on http://npmjs.com/melf

Latest version **0.0.0** (published 2018-06-12) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install melf-sharing
pnpm add melf-sharing
yarn add melf-sharing
bun add melf-sharing
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.0 |
| Published | 2018-06-12 |
| First published | 2018-06-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 38.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Laurent Christophe |
| Maintainers | lachrist |
| Keywords | Sharing, Serialize, Instantatiate, Far References, Melf, Synchronous, Asynchronous |

## Links

- npm: https://www.npmjs.com/package/melf-sharing
- Repository: https://github.com/lachrist/melf-sharing
- Homepage: http://github.com/lachrist/kalah
- Issues: https://github.com/lachrist/melf-sharing/issues
- npm.io page: https://npm.io/package/melf-sharing

## Dependencies (1)

- [lenient-proxy](https://npm.io/package/lenient-proxy.md) 0.0.0

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 0.0.0 (latest) — 2018-06-12

## README

# MelfShare <img src="kalah.png" align="right" alt="kalah-logo" title="Kalah, the Gnome Illusionist"/>

(A)Synchronous remote references based on [melf](https://www.npmjs.com/package/melf).

## `{serialize, instantiate, ownerof, discard} = require("melf-share")(melf, {synchronous, namespace})`

* `melf :: melf.Melf`
* `synchronous :: boolean | undefined`
* `namespace :: string | undefined`
* `alias = ownerof(value)`
  * `value :: object | symbol`
  * `alias :: string`
* `success = discard(value)`
  * `value :: object | symbol`
  * `success :: boolean`
* `data = serialize(value, hint)`
  * `value :: *`
  * `hint :: Hint`
  * `data :: JSON`
* `value = instantiate(data)`
  * `data :: JSON`
  * `value :: *`

## Hints

* Primitive:
  Serialize *any* value, the value of the primitive is for documentation only.
  After instantiation:
  * non-symbolic primitives:
    will refer to the same value (`undefined`, `NaN`, `+Infinity`, `-Infinity`, `-0` are supported).
  * [well-known and global symbol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol):
    will refer the local corresponding well-known/global symbol.
  * other symbols:
    will refer to a dedicated symbol with the same string representation.
  * objects:
    will refer to a dedicated proxy whose traps forward operations to the serializing process.
* Array of hint:
  The elements of a hint-array are hints which will be used to convert the corresponding element of the given value.
  Instantiation will result to a new local array.
* Object of hint:
  The properties of a hint-object are hints which will be used to convert the corresponding properties of the given value.
  Instantiation will result in a new local object.

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