Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
events-to-array
Advanced tools
Put a bunch of emitted events in an array, for testing.
var assert = require('assert')
var EE = require('events')
var etoa = require('events-to-array')
var emitter = new EE()
var array = etoa(emitter)
emitter.emit('foo', 1, 2, 3)
emitter.emit('bar', { x: 1 })
// nested events get tracked as well
var subemit = new EE()
emitter.emit('sub', subemit)
subemit.emit('childEvent', { some: 'data' })
subemit.emit('anotherone', { some: 'data' }, 'many', 'args')
// CAVEAT!
emitter.emit('blaz', 'blorrg')
subemit.emit('order', 'not', 'preserved between child and parent')
// check out the array whenever
assert.deepEqual(array,
[ [ 'foo', 1, 2, 3 ],
[ 'bar', { x: 1 } ],
[ 'sub',
[ [ 'childEvent', { some: 'data' } ],
[ 'anotherone', { some: 'data' }, 'many', 'args' ],
[ 'order', 'not', 'preserved between child and parent' ] ] ],
[ 'blaz', 'blorrg' ] ])
eventsToArray(emitter, [ignoreList])
Returns an array with all the events emitted by the emitter.
It's your responsibility to know when to check it for the events that you expect.
FAQs
Put a bunch of emitted events in an array, for testing.
The npm package events-to-array receives a total of 363,304 weekly downloads. As such, events-to-array popularity was classified as popular.
We found that events-to-array demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.