# @hyanmandian/micro-easy

> The easiest way to use Micro Frontends approach.

Latest version **0.1.4** (published 2020-03-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @hyanmandian/micro-easy
pnpm add @hyanmandian/micro-easy
yarn add @hyanmandian/micro-easy
bun add @hyanmandian/micro-easy
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2020-03-18 |
| First published | 2020-03-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 218.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Hyan Mandian |
| Maintainers | hyanmandian |
| Keywords | embed, iframe, handshake, typescript, postmessage, event-driven, microfrontend, microfrontends |

## Links

- npm: https://www.npmjs.com/package/@hyanmandian/micro-easy
- Repository: https://github.com/hyanmandian/micro-easy
- Homepage: https://github.com/hyanmandian/micro-easy#readme
- Issues: https://github.com/hyanmandian/micro-easy/issues
- npm.io page: https://npm.io/package/@hyanmandian/micro-easy

## 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.4 (latest) — 2020-03-18
- 0.1.3 — 2020-03-18
- 0.1.2 — 2020-03-18
- 0.1.1 — 2020-03-17
- 0.1.0 — 2020-03-17

## README

![Package size](https://badgen.net/bundlephobia/minzip/@hyanmandian/micro-easy)

# Micro Easy

The easiest way to use [Micro Frontends](https://micro-frontends.org/) approach.

## Features

- Handshake;
- Super tiny;
- Auto resize;
- Lazy loading;
- Error handling;
- Two way communication (child to parent and parent to child).

## Getting started

```html
<!-- load our library in parent and child app -->
<script src="https://unpkg.com/@hyanmandian/micro-easy@0.1.4/dist/micro-easy.umd.production.min.js"></script>

<!-- load your child app on parent app and interact with it -->
<button>Ping</button>
<micro-easy
  src="http://example.com/"
  name="child"
  sandbox="allow-scripts allow-same-origin"
></micro-easy>
<script>
  async function init() {
    try {
      const child = await MicroEasy.getChild('child');

      child.on('pong', () => {
        console.log('pong');
      });

      document.querySelector('button').addEventListener('click', () => {
        child.emit('ping');
      });
    } catch (e) {
      // handle error (invalid_origin | not_found)
    }
  }

  init();
</script>

<!-- wrap your child app and interact with parent app -->
<micro-easy-wrapper>
  <button>Pong</button>
</micro-easy-wrapper>
<script>
  async function init() {
    try {
      const parent = await MicroEasy.getParent();

      parent.on('ping', () => {
        console.log('ping');
      });

      document.querySelector('button').addEventListener('click', () => {
        parent.emit('pong');
      });
    } catch (e) {
      // handle error (not_embedded)
    }
  }

  init();
</script>
```

## License

[MIT](LICENSE)

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