Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@okamjs/okam

Package Overview
Dependencies
Maintainers
1
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@okamjs/okam - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7-canary.20230808.1

50

index.d.ts

@@ -6,27 +6,25 @@ /* tslint:disable */

export function build(
root: string,
config: {
entry?: Record<string, string>;
output?: { path: string };
resolve?: {
alias?: Record<string, string>;
extensions?: string[];
};
mode?: 'development' | 'production';
define?: Record<string, string>;
devtool?: 'source-map' | 'inline-source-map';
externals?: Record<string, string>;
copy?: string[];
providers?: Record<string, string[]>;
public_path?: string;
inline_limit?: number;
targets?: Record<string, number>;
platform?: 'node' | 'browser';
hmr?: boolean;
hmr_port?: string;
hmr_host?: string;
stats?: boolean;
},
watch: boolean,
): Promise<void>;
export function build(root: string, config:
{
entry?: Record<string, string>;
output?: {path: string};
resolve?: {
alias?: Record<string, string>;
extensions?: string[];
};
manifest?: boolean;
mode?: "development" | "production";
define?: Record<string, string>;
devtool?: "source-map" | "inline-source-map";
externals?: Record<string, string>;
copy?: string[];
providers?: Record<string, string[]>;
public_path?: string;
inline_limit?: number;
targets?: Record<string, number>;
platform?: "node" | "browser";
hmr?: boolean;
hmr_port?: string;
hmr_host?: string;
stats?: boolean;
}, watch: boolean): Promise<void>

@@ -1,9 +0,9 @@

const { existsSync, readFileSync } = require('fs');
const { join } = require('path');
const { existsSync, readFileSync } = require('fs')
const { join } = require('path')
const { platform, arch } = process;
const { platform, arch } = process
let nativeBinding = null;
let localFileExisted = false;
let loadError = null;
let nativeBinding = null
let localFileExisted = false
let loadError = null

@@ -14,13 +14,10 @@ function isMusl() {

try {
const lddPath = require('child_process')
.execSync('which ldd')
.toString()
.trim();
return readFileSync(lddPath, 'utf8').includes('musl');
const lddPath = require('child_process').execSync('which ldd').toString().trim();
return readFileSync(lddPath, 'utf8').includes('musl')
} catch (e) {
return true;
return true
}
} else {
const { glibcVersionRuntime } = process.report.getReport().header;
return !glibcVersionRuntime;
const { glibcVersionRuntime } = process.report.getReport().header
return !glibcVersionRuntime
}

@@ -33,33 +30,29 @@ }

case 'arm64':
localFileExisted = existsSync(
join(__dirname, 'okam.android-arm64.node'),
);
localFileExisted = existsSync(join(__dirname, 'okam.android-arm64.node'))
try {
if (localFileExisted) {
nativeBinding = require('./okam.android-arm64.node');
nativeBinding = require('./okam.android-arm64.node')
} else {
nativeBinding = require('@okamjs/okam-android-arm64');
nativeBinding = require('@okamjs/okam-android-arm64')
}
} catch (e) {
loadError = e;
loadError = e
}
break;
break
case 'arm':
localFileExisted = existsSync(
join(__dirname, 'okam.android-arm-eabi.node'),
);
localFileExisted = existsSync(join(__dirname, 'okam.android-arm-eabi.node'))
try {
if (localFileExisted) {
nativeBinding = require('./okam.android-arm-eabi.node');
nativeBinding = require('./okam.android-arm-eabi.node')
} else {
nativeBinding = require('@okamjs/okam-android-arm-eabi');
nativeBinding = require('@okamjs/okam-android-arm-eabi')
}
} catch (e) {
loadError = e;
loadError = e
}
break;
break
default:
throw new Error(`Unsupported architecture on Android ${arch}`);
throw new Error(`Unsupported architecture on Android ${arch}`)
}
break;
break
case 'win32':

@@ -69,104 +62,102 @@ switch (arch) {

localFileExisted = existsSync(
join(__dirname, 'okam.win32-x64-msvc.node'),
);
join(__dirname, 'okam.win32-x64-msvc.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./okam.win32-x64-msvc.node');
nativeBinding = require('./okam.win32-x64-msvc.node')
} else {
nativeBinding = require('@okamjs/okam-win32-x64-msvc');
nativeBinding = require('@okamjs/okam-win32-x64-msvc')
}
} catch (e) {
loadError = e;
loadError = e
}
break;
break
case 'ia32':
localFileExisted = existsSync(
join(__dirname, 'okam.win32-ia32-msvc.node'),
);
join(__dirname, 'okam.win32-ia32-msvc.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./okam.win32-ia32-msvc.node');
nativeBinding = require('./okam.win32-ia32-msvc.node')
} else {
nativeBinding = require('@okamjs/okam-win32-ia32-msvc');
nativeBinding = require('@okamjs/okam-win32-ia32-msvc')
}
} catch (e) {
loadError = e;
loadError = e
}
break;
break
case 'arm64':
localFileExisted = existsSync(
join(__dirname, 'okam.win32-arm64-msvc.node'),
);
join(__dirname, 'okam.win32-arm64-msvc.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./okam.win32-arm64-msvc.node');
nativeBinding = require('./okam.win32-arm64-msvc.node')
} else {
nativeBinding = require('@okamjs/okam-win32-arm64-msvc');
nativeBinding = require('@okamjs/okam-win32-arm64-msvc')
}
} catch (e) {
loadError = e;
loadError = e
}
break;
break
default:
throw new Error(`Unsupported architecture on Windows: ${arch}`);
throw new Error(`Unsupported architecture on Windows: ${arch}`)
}
break;
break
case 'darwin':
localFileExisted = existsSync(
join(__dirname, 'okam.darwin-universal.node'),
);
localFileExisted = existsSync(join(__dirname, 'okam.darwin-universal.node'))
try {
if (localFileExisted) {
nativeBinding = require('./okam.darwin-universal.node');
nativeBinding = require('./okam.darwin-universal.node')
} else {
nativeBinding = require('@okamjs/okam-darwin-universal');
nativeBinding = require('@okamjs/okam-darwin-universal')
}
break;
break
} catch {}
switch (arch) {
case 'x64':
localFileExisted = existsSync(join(__dirname, 'okam.darwin-x64.node'));
localFileExisted = existsSync(join(__dirname, 'okam.darwin-x64.node'))
try {
if (localFileExisted) {
nativeBinding = require('./okam.darwin-x64.node');
nativeBinding = require('./okam.darwin-x64.node')
} else {
nativeBinding = require('@okamjs/okam-darwin-x64');
nativeBinding = require('@okamjs/okam-darwin-x64')
}
} catch (e) {
loadError = e;
loadError = e
}
break;
break
case 'arm64':
localFileExisted = existsSync(
join(__dirname, 'okam.darwin-arm64.node'),
);
join(__dirname, 'okam.darwin-arm64.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./okam.darwin-arm64.node');
nativeBinding = require('./okam.darwin-arm64.node')
} else {
nativeBinding = require('@okamjs/okam-darwin-arm64');
nativeBinding = require('@okamjs/okam-darwin-arm64')
}
} catch (e) {
loadError = e;
loadError = e
}
break;
break
default:
throw new Error(`Unsupported architecture on macOS: ${arch}`);
throw new Error(`Unsupported architecture on macOS: ${arch}`)
}
break;
break
case 'freebsd':
if (arch !== 'x64') {
throw new Error(`Unsupported architecture on FreeBSD: ${arch}`);
throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
}
localFileExisted = existsSync(join(__dirname, 'okam.freebsd-x64.node'));
localFileExisted = existsSync(join(__dirname, 'okam.freebsd-x64.node'))
try {
if (localFileExisted) {
nativeBinding = require('./okam.freebsd-x64.node');
nativeBinding = require('./okam.freebsd-x64.node')
} else {
nativeBinding = require('@okamjs/okam-freebsd-x64');
nativeBinding = require('@okamjs/okam-freebsd-x64')
}
} catch (e) {
loadError = e;
loadError = e
}
break;
break
case 'linux':

@@ -177,77 +168,77 @@ switch (arch) {

localFileExisted = existsSync(
join(__dirname, 'okam.linux-x64-musl.node'),
);
join(__dirname, 'okam.linux-x64-musl.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./okam.linux-x64-musl.node');
nativeBinding = require('./okam.linux-x64-musl.node')
} else {
nativeBinding = require('@okamjs/okam-linux-x64-musl');
nativeBinding = require('@okamjs/okam-linux-x64-musl')
}
} catch (e) {
loadError = e;
loadError = e
}
} else {
localFileExisted = existsSync(
join(__dirname, 'okam.linux-x64-gnu.node'),
);
join(__dirname, 'okam.linux-x64-gnu.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./okam.linux-x64-gnu.node');
nativeBinding = require('./okam.linux-x64-gnu.node')
} else {
nativeBinding = require('@okamjs/okam-linux-x64-gnu');
nativeBinding = require('@okamjs/okam-linux-x64-gnu')
}
} catch (e) {
loadError = e;
loadError = e
}
}
break;
break
case 'arm64':
if (isMusl()) {
localFileExisted = existsSync(
join(__dirname, 'okam.linux-arm64-musl.node'),
);
join(__dirname, 'okam.linux-arm64-musl.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./okam.linux-arm64-musl.node');
nativeBinding = require('./okam.linux-arm64-musl.node')
} else {
nativeBinding = require('@okamjs/okam-linux-arm64-musl');
nativeBinding = require('@okamjs/okam-linux-arm64-musl')
}
} catch (e) {
loadError = e;
loadError = e
}
} else {
localFileExisted = existsSync(
join(__dirname, 'okam.linux-arm64-gnu.node'),
);
join(__dirname, 'okam.linux-arm64-gnu.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./okam.linux-arm64-gnu.node');
nativeBinding = require('./okam.linux-arm64-gnu.node')
} else {
nativeBinding = require('@okamjs/okam-linux-arm64-gnu');
nativeBinding = require('@okamjs/okam-linux-arm64-gnu')
}
} catch (e) {
loadError = e;
loadError = e
}
}
break;
break
case 'arm':
localFileExisted = existsSync(
join(__dirname, 'okam.linux-arm-gnueabihf.node'),
);
join(__dirname, 'okam.linux-arm-gnueabihf.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./okam.linux-arm-gnueabihf.node');
nativeBinding = require('./okam.linux-arm-gnueabihf.node')
} else {
nativeBinding = require('@okamjs/okam-linux-arm-gnueabihf');
nativeBinding = require('@okamjs/okam-linux-arm-gnueabihf')
}
} catch (e) {
loadError = e;
loadError = e
}
break;
break
default:
throw new Error(`Unsupported architecture on Linux: ${arch}`);
throw new Error(`Unsupported architecture on Linux: ${arch}`)
}
break;
break
default:
throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`);
throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`)
}

@@ -257,9 +248,9 @@

if (loadError) {
throw loadError;
throw loadError
}
throw new Error(`Failed to load native binding`);
throw new Error(`Failed to load native binding`)
}
const { build } = nativeBinding;
const { build } = nativeBinding
module.exports.build = build;
module.exports.build = build
{
"name": "@okamjs/okam",
"version": "0.0.6",
"version": "0.0.7-canary.20230808.1",
"main": "index.js",

@@ -29,5 +29,5 @@ "types": "index.d.ts",

"optionalDependencies": {
"@okamjs/okam-darwin-arm64": "0.0.6",
"@okamjs/okam-darwin-x64": "0.0.6",
"@okamjs/okam-linux-x64-gnu": "0.0.6"
"@okamjs/okam-darwin-arm64": "0.0.6-canary.2023.08.09.1",
"@okamjs/okam-darwin-x64": "0.0.6-canary.2023.08.09.1",
"@okamjs/okam-linux-x64-gnu": "0.0.6-canary.2023.08.09.1"
},

@@ -37,2 +37,4 @@ "scripts": {

"build": "napi build --platform --release",
"build:mac:x86": "napi build --platform --release --target x86_64-apple-darwin",
"build:mac:aarch": "napi build --platform --release --target aarch64-apple-darwin",
"build:debug": "napi build --platform",

@@ -39,0 +41,0 @@ "test": "ava",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc