UNPKG

node-libcurl-ja3

Version:

Node.js native bindings for libcurl-impersonate. Impersonate Chrome, Edge, Firefox and Safari TLS fingerprints.

22 lines 1.22 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NODE_LIBCURL_BINDING = void 0; const tslib_1 = require("tslib"); /* eslint-disable @typescript-eslint/no-var-requires */ const node_fs_1 = tslib_1.__importDefault(require("node:fs")); const node_path_1 = tslib_1.__importDefault(require("node:path")); const pkg = require('../package.json'); const moduleParent = pkg.binary.module_path.split('{configuration}', 1); let nodeLibcurlBindingPath; if (moduleParent.length === 1) { nodeLibcurlBindingPath = node_path_1.default.join(node_path_1.default.join(__dirname, '..'), moduleParent[0], `${pkg.binary.module_name}.node`); } if (!nodeLibcurlBindingPath || !node_fs_1.default.existsSync(nodeLibcurlBindingPath)) { nodeLibcurlBindingPath = node_path_1.default.join(node_path_1.default.join(__dirname, '..'), pkg.binary.module_path .replaceAll('{configuration}', `Release`) .replaceAll('{node_abi}', `node-v${process.versions.modules}`) .replaceAll('{platform}', process.platform) .replaceAll('{arch}', process.arch), `${pkg.binary.module_name}.node`); } exports.NODE_LIBCURL_BINDING = require(nodeLibcurlBindingPath); //# sourceMappingURL=binding.js.map