1.0.5 • Published 6 years ago

post-msg v1.0.5

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

Travis CI devDependency Status js-standard-style

post-msg

Post message made simple

  • Tiny
  • 100% test coverage
  • performant

Installation

npm install --save post-msg

Usage

var createPostMsg = require('post-msg')
var postMsg = createPostMsg(targetWindow, '*')

postMsg.on('*', log) // listen to all post messages from the targetWindow

postMsg.on('namespace', log) // listen for namespaced post messages from the targetWindow

postMsg.emit('hello', { data: true }) // send a post message to the targetWindow

postMsg.dispose() // remove all event and post message listeners

function log (type, data, origin, source) {
  console.log(type, data, origin, source)
}
1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago