Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

hs2-mock

Latest version: v0.3.1

Overview

Last scanned
28 Nov 2026
Published
28 Nov 2026
npm package Publisher: hugoha
0 Stars
0 Forks
5 Versions
JavaScript Repo language

Scan summary

hs2-mock was last scanned on 28 Nov 2026 at version 0.3.1. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 5 versions, all published on 28 Nov 2026.
  • Findings: No rules fired in version 0.3.1.

Versions

5 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.3.1 LATEST 28 Nov 2026 No rules fired
0.3.0 28 Nov 2026 No rules fired
0.2.0 28 Nov 2026 No rules fired
0.1.0 28 Nov 2026 Not shown
0.0.0-stage 28 Nov 2026 Not shown

No rules fired in 0.3.1

Findings

Findings for v0.3.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.3.1; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

hs2-mock

A strict mock of the Hammerspoon 2 hs global, for testing Spoons with node:test. It also ships the matching hammerspoon.d.ts for type checking.

npm install --save-dev hs2-mock
const { createHs, loadSpoon } = require("hs2-mock");

const { hs, ctl } = createHs();
const spoon = loadSpoon(`${__dirname}/..`, hs);

ctl.addApp({ bundleID: "com.apple.Preview" });
spoon.monitor([{ bundleID: "com.apple.Preview", idleTime: 60 }]).start();
await ctl.advance(600);
assert.deepEqual(ctl.killed, ["com.apple.Preview"]);

Reading a member the mock lacks throws hs2-mock: hs.x.y is not mocked. Tests can add or replace anything.

Mocked

Module Members
hs.appinfo pid
hs.application frontmost, fromPID, launchOrFocus, matchingBundleID, on, off
hs.audiodevice allInputDevices, allOutputDevices, defaultInputDevice, defaultOutputDevice, on, off
hs.ax applicationElement, windowElement
hs.distributednotifications on, off
hs.fs (in memory) exists, homeDirectory, mkdir, read, urlFromPath, write
hs.hotkey bind, create
hs.menubar create (title, setIcon, setMenu, destroy)
hs.notify show, create (send)
hs.permissions checkAccessibility, checkLocation, requestLocation, requestNotifications
hs.power on, off
hs.screen main
hs.task create, runAsync
hs.timer absoluteTime, doAfter, doEvery, secondsSinceEpoch
hs.ui alert, dialog, webview, window
hs.urlevent openURL
hs.wifi currentNetwork, on, off
HSImage, HSSize globals fromName, fromSymbol

Controls (ctl)

Control Does
advance(seconds) Moves the clock, firing timers and settling promises between them
flush() Settles pending promises
addApp({ bundleID, name, allWindows, focusedWindow, mainWindow }) Adds a running app and returns it
activate(bundleID) Brings an app to the front and emits didActivate; null for one without a bundle ID
killed, launched, activations, raised Apps killed, launched and activated, and windows raised
frontmostRequests Times Hammerspoon asked to be frontmost
element({ role, children, attributes }) An accessibility element
window(element) A window whose element it is
url(text) A URL attribute value, as hs.ax returns it
hotkeys Created hotkeys that have not been destroyed
tasks Started tasks: launchPath, args, environment, running, terminated, inputClosed, finish({ stdout, exitCode, reason, error })
respondToTasks(handler) Answers each task as it starts with what finish() takes, or undefined to leave it running
menubarItems Menu bar items: item, icon, menu, destroyed
notifications title, body; click() for show() ones, options for create() ones
dialogs message, informativeText, buttons, open, press(label)
windows rect, title, view.html, view.post(name, body), shown, userClose()
alerts, openedURLs What was shown and opened
files, dirs, home, writeFails The in-memory file system
power(event), notify(name) Emits an hs.power event or a distributed notification
ssid, wifi(event) The current Wi-Fi network, and its events
addAudioDevice({ name, uid, input }) Adds an audio device (emits dev+) and returns it
removeAudioDevice(device) Removes it (emits dev-)
setDefaultAudioDevice(direction, device) Sets the default and emits dOut or dIn
updateAudioDevice(device, changes) Sets volume or muted and emits the device event
audioListeners() Number of audio listeners registered
images Add the names HSImage.fromName can load
accessibility, location, notificationPermission Whether each permission is granted
locationRequests How often location permission was requested

Types

Add node_modules/hs2-mock/types/*.d.ts to your tsconfig.json, with "types": []. The version they come from is in types/VERSION; refresh with mise run vendor <tag>. hammerspoon.d.ts is MIT-licensed, copyright the Hammerspoon contributors.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm hs2-mock

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Critical Apache HTTP Server Flaw Exposes Web Servers to RCE (1)
CVE

CVE-2026-119618: Critical Apache HTTP Server Flaw Exposes Web Servers to Remote Code Execution

Vulnerability Insights

Compromised Claude Code extensions (versions 2.1.312 & 2.1.313) in Cursor try to install a backdoor

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

Frame 2085668439 (1)
Group 1261154229