mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-28 06:53:42 +08:00
A statement-level require() of a package nothing installed threw a plain Error; the expression form already carried Node's MODULE_NOT_FOUND code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
10 lines
260 B
JavaScript
10 lines
260 B
JavaScript
// @ts-check
|
|
let status = "unset";
|
|
try {
|
|
require("scriptc-test-definitely-not-installed");
|
|
status = "installed";
|
|
} catch (e) {
|
|
status = "missing: " + e.code + " " + String(e.message).split("\n")[0];
|
|
}
|
|
exports.probe = function probe() { return status; };
|