libmagic-ffi
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -30,5 +30,12 @@ "use strict"; | ||
let lastError; | ||
const PLATFORM_SPECIFIC_SUFFIX = { | ||
win32: '.dll', | ||
darwin: '.dylib', | ||
linux: '.so', | ||
}; | ||
const dynamicLibSuffix = Reflect.get(PLATFORM_SPECIFIC_SUFFIX, process.platform) || '.so'; | ||
for (const x of [dlOpenPath, 'libmagic.1', 'libmagic']) { | ||
const fixedName = x.toLowerCase().endsWith(dynamicLibSuffix) ? x : x + dynamicLibSuffix; | ||
try { | ||
sharedLib = koffi_1.default.load(x); | ||
sharedLib = koffi_1.default.load(fixedName); | ||
break; | ||
@@ -35,0 +42,0 @@ } |
{ | ||
"name": "libmagic-ffi", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Node bindings for libmagic using ffi", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
Sorry, the diff of this file is not supported yet
24532
395