epml

0.3.3 • Public • Published

epml

An Extensible PostMessage Library

Added streamsss

NEED TO MAKE NAMING MORE CONSISTENT PLEASE AND THANK YOU ... what was that meant to mean? ^^^ Add unsubscribe method to streams...i.e.

const parentEpml = new Epml({type: 'WINDOW', source: window.parent }) 
const addressSubscription = parentEpml.subscribe('address', () => {...})
...
addressSubscription.unsubscribe()

Add Epml.logging option...options for verbose or off, default to off or false I guess

Planned features:

  • Plugin system, allowing Wimp to be split up into the following modules:
    • wimp-core - Duh. Doesn't do much on it's own. Has the basic request features built in...or should that be a seperate plugin
    • wimp-iframes - Allows wimp to communicate with iframes with popup windows
    • wimp-broadcast-channel - Allows wimp to communicate through broadcast channels
    • wimp-workers - Allows wimp to communicate to/from web workers
    • wimp-streams - Adds streams...i.e. websocket connections to Wimp
    • wimp-proxy - Allows routes to be proxied between windows and frames. An alternative to broadcast channel when communicating cross-origin
    • wimp-server - Possible future improvement. Add support for communicating with a node server. This could look like using wimp to proxy cross origin domains to a server that doesn't allow cors. Might be overkill...but then should also be a light plugin.
    • wimp-requests - Maybe...makes simple requests and routes possible...i.e. HTTP GET
    • wimp-encrypt - Publickey cryptography implementation to make communication between frames private
  • Fully ES6...supporting async functions for routes, and getting rid of callback support for things like requests.
  • Advanced routing, i.e. allowing for routes such as accounts/:accountID
  • Hapijs inspiration - Take route objects such as in hapi, as below. This could allow for route plugins, who knows
{
    route: "account/:accountID",
   handler: async request => {
    return db.get(request.accountID)
   }
}```

Package Sidebar

Install

npm i epml

Weekly Downloads

1

Version

0.3.3

License

MIT

Unpacked Size

1.27 MB

Total Files

97

Last publish

Collaborators

  • irontiga