You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

knowns

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

knowns - npm Package Compare versions

Comparing version
0.15.0
to
0.15.1
+42
-27
bin/knowns.js

@@ -7,3 +7,18 @@ #!/usr/bin/env node

const fs = require("fs");
const Module = require("module");
function uniq(values) {
return [...new Set(values)];
}
function resolveFromPackageDir(pkgDir, ext) {
for (const name of [`knowns${ext}`, "knowns"]) {
const candidate = path.join(pkgDir, name);
if (fs.existsSync(candidate)) {
return candidate;
}
}
return null;
}
function getBinaryPath() {

@@ -35,35 +50,35 @@ const platform = os.platform();

const ext = platform === "win32" ? ".exe" : "";
const pkgParts = pkgName.split("/");
// Try to find in node_modules (installed as optionalDependency)
const candidates = [
// npm/pnpm standard layout
path.join(__dirname, "..", "node_modules", pkgName, `knowns${ext}`),
// pnpm hoisted
path.join(__dirname, "..", "..", pkgName, `knowns${ext}`),
// npm hoisted
path.join(
__dirname,
"..",
"..",
"..",
"node_modules",
pkgName,
`knowns${ext}`
),
// Global install
path.join(__dirname, "..", "..", pkgName, `knowns${ext}`),
];
const packageDirs = uniq([
path.resolve(__dirname, "..", "node_modules", ...pkgParts),
path.resolve(__dirname, "..", "..", ...pkgParts),
path.resolve(__dirname, "..", "..", "node_modules", ...pkgParts),
path.resolve(__dirname, "..", "..", "..", "node_modules", ...pkgParts),
...module.paths.map((base) => path.join(base, ...pkgParts)),
...Module.globalPaths.map((base) => path.join(base, ...pkgParts)),
]);
for (const candidate of candidates) {
if (fs.existsSync(candidate)) {
return candidate;
for (const pkgDir of packageDirs) {
const resolved = resolveFromPackageDir(pkgDir, ext);
if (resolved) {
return resolved;
}
}
// Try require.resolve as last resort
for (const base of uniq([__dirname, process.cwd(), ...module.paths, ...Module.globalPaths])) {
try {
const pkgJson = require.resolve(`${pkgName}/package.json`, { paths: [base] });
const resolved = resolveFromPackageDir(path.dirname(pkgJson), ext);
if (resolved) {
return resolved;
}
} catch {}
}
try {
const pkgDir = path.dirname(require.resolve(`${pkgName}/package.json`));
const binary = path.join(pkgDir, `knowns${ext}`);
if (fs.existsSync(binary)) {
return binary;
const pkgJson = require.resolve(`${pkgName}/package.json`);
const resolved = resolveFromPackageDir(path.dirname(pkgJson), ext);
if (resolved) {
return resolved;
}

@@ -70,0 +85,0 @@ } catch {}

{
"name": "knowns",
"version": "0.15.0",
"version": "0.15.1",
"description": "AI-native project management CLI",

@@ -11,8 +11,8 @@ "bin": {

"optionalDependencies": {
"@knowns/darwin-arm64": "0.15.0",
"@knowns/darwin-x64": "0.15.0",
"@knowns/linux-arm64": "0.15.0",
"@knowns/linux-x64": "0.15.0",
"@knowns/win-arm64": "0.15.0",
"@knowns/win-x64": "0.15.0"
"@knowns/darwin-arm64": "0.15.1",
"@knowns/darwin-x64": "0.15.1",
"@knowns/linux-arm64": "0.15.1",
"@knowns/linux-x64": "0.15.1",
"@knowns/win-arm64": "0.15.1",
"@knowns/win-x64": "0.15.1"
},

@@ -19,0 +19,0 @@ "license": "MIT",