We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c16bda9 commit c35391fCopy full SHA for c35391f
1 file changed
lib/node_modules/@stdlib/strided/common/examples/addon-napi-polymorphic/index.js
@@ -18,17 +18,13 @@
18
19
'use strict';
20
21
+var join = require( 'path' ).join;
22
+var tryRequire = require( '@stdlib/utils/try-require' );
23
var Float64Array = require( '@stdlib/array/float64' );
24
var Float32Array = require( '@stdlib/array/float32' ); // eslint-disable-line stdlib/require-last-path-relative
25
-var add;
-
26
// Try loading the add-on:
27
-try {
28
- add = require( './addon.node' );
29
-} catch ( err ) {
30
- add = err;
31
-}
+var add = tryRequire( join( __dirname, 'addon.node' ) );
32
33
/**
34
* Main execution sequence.
0 commit comments