sherpa-onnx-node
Advanced tools
Comparing version 1.0.7 to 1.0.8
30
addon.js
@@ -7,2 +7,3 @@ const os = require('os'); | ||
`./node_modules/sherpa-onnx-${platform_arch}/sherpa-onnx.node`, | ||
`../sherpa-onnx-${platform_arch}/sherpa-onnx.node`, | ||
]; | ||
@@ -24,4 +25,29 @@ | ||
if (!found) { | ||
throw new Error( | ||
`Could not find sherpa-onnx. Tried\n\n ${possible_paths.join('\n ')}\n`) | ||
let msg = | ||
`Could not find sherpa-onnx. Tried\n\n ${possible_paths.join('\n ')}\n` | ||
if (os.platform() == 'darwin' && | ||
!process.env.DYLD_LIBRARY_PATH.includes( | ||
`node_modules/sherpa-onnx-${platform_arch}`)) { | ||
msg += | ||
'Please remeber to set the following environment variable and try again:\n'; | ||
msg += `export DYLD_LIBRARY_PATH=${ | ||
process.env.PWD}/node_modules/sherpa-onnx-${platform_arch}`; | ||
msg += ':$DYLD_LIBRARY_PATH\n'; | ||
} | ||
if (os.platform() == 'linux' && | ||
!process.env.LD_LIBRARY_PATH.includes( | ||
`node_modules/sherpa-onnx-${platform_arch}`)) { | ||
msg += | ||
'Please remeber to set the following environment variable and try again:\n'; | ||
msg += `export LD_LIBRARY_PATH=${ | ||
process.env.PWD}/node_modules/sherpa-onnx-${platform_arch}`; | ||
msg += ':$LD_LIBRARY_PATH\n'; | ||
} | ||
throw new Error(msg) | ||
} |
{ | ||
"name": "sherpa-onnx-node", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Speech-to-text and text-to-speech using Next-gen Kaldi without internet connection", | ||
@@ -48,6 +48,6 @@ "main": "sherpa-onnx.js", | ||
"optionalDependencies": { | ||
"sherpa-onnx-darwin-arm64": "^1.0.7", | ||
"sherpa-onnx-darwin-x64": "^1.0.7", | ||
"sherpa-onnx-linux-x64": "^1.0.7" | ||
"sherpa-onnx-darwin-arm64": "^1.0.8", | ||
"sherpa-onnx-darwin-x64": "^1.0.8", | ||
"sherpa-onnx-linux-x64": "^1.0.8" | ||
} | ||
} |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
3917
82
5