
Security News
Socket Security Analysis Is Now One Click Away on npm
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.
spatial-events
Advanced tools
a spatially-aware event emitter, designed to work in 3d space with axis aligned bounding boxes.
listeners may be attached with a name and a bounding box, and events may be emitted with a name, bounding box or point, and arguments.
var spatial = require('spatial-events')
, aabb = require('aabb-3d')
var ee = new spatial
ee.on('explosion', aabb([0, 0, 0], [40, 40, 40]), function(arg) {
console.log('an explosion happened and it was '+arg)
})
ee.emit('explosion', [20, 20, 20], 'overrated')
ee.emit('explosion', aabb([-Infinity, -Infinity, -Infinity], [Infinity, Infinity, Infinity]), 'without measure')
ee.emit('explosion', aabb([-20, -20, -20], [10, 10, 10]), 'never heard')
The event emitter creates an Octree under the covers, which exponentially increases the size of its coordinate system to fit bounding box listeners that are added.
Infinite listeners are stored in a separate structure.
In practice, this means that any "large" listener will be fired after any "small" listener, generally speaking -- events bubble up.
MIT
FAQs
3d spatially-aware event emitter
We found that spatial-events 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
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.

Security News
A compromised npm publish token was used to push a malicious postinstall script in cline@2.3.0, affecting the popular AI coding agent CLI with 90k weekly downloads.

Product
Socket is now scanning AI agent skills across multiple languages and ecosystems, detecting malicious behavior before developers install, starting with skills.sh's 60,000+ skills.