Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@looker/chatty
Advanced tools
A simple web browser iframe host/client channel message manager. It uses MessageChannels to avoid cross-talk between multiple iframes. It allows configuring the iframe to run in sandboxed mode.
A user first initiates the creation of a client iframe using the createHost(url)
method, adding event
handlers using on(eventName, data)
. They then creates the iframe using build()
, and opens
a communication channel using connect()
. Once the channel opens, the user can send messages to
the client with send(eventName, data)
import { Chatty } from 'chatty'
Chatty.createHost('//example.com/client.html')
.on(Actions.SET_STATUS, (msg: Msg) => {
const status: Element = document.querySelector('#host-status')!
status.innerHTML = `${msg.status} 1`
})
.build()
.connect()
.then(client => {
document.querySelector('#change-status')!.addEventListener('click', () => {
client.send(Actions.SET_STATUS, { status: 'Message to client 1' })
})
})
.catch(console.error)
The client iframe
creates its client using createClient()
. It also adds event listeners, builds the
client and connects. Once connected, it can send messages to its host.
import { Chatty } from 'chatty'
Chatty.createClient()
.on(Actions.SET_STATUS, (msg: Msg) => {
const status = document.querySelector('#client-status')!
status.innerHTML = msg.status
})
.build()
.connect()
.then(host => {
document.querySelector('#change-status')!.addEventListener('click', () => {
host.send(Actions.SET_STATUS, { status: 'click from client' })
})
})
.catch(console.error)
npm install
npm test
npm start
/src
- This is where you should do all the work on Chatty./lib
- This is the built output generated by running npm run build
. No editing should be done here./demo
- This is what is hosted by WebpackDevServer via npm start
. Use this to build a demo and test Chatty in real time (no need to refresh the page manually or restart the dev server, it does that for you).npm run build
- runs the Typescript compiler, outputting all generated source files to /lib
. Run this when creating a new build to distribute on github.npm run lint
- runs the ts linternpm run lint-fix
- runs the ts linter and attempts to auto fix problemsnpm start
- starts a dev server mounted on /demo
.npm test
- runs the test suite for Chatty.FAQs
A simple postMessage host / client channel manager.
The npm package @looker/chatty receives a total of 37,723 weekly downloads. As such, @looker/chatty popularity was classified as popular.
We found that @looker/chatty demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.