Skip to content

Commit c35391f

Browse files
authored
docs: fix example
Signed-off-by: Athan <kgryte@gmail.com>
1 parent c16bda9 commit c35391f

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

  • lib/node_modules/@stdlib/strided/common/examples/addon-napi-polymorphic

lib/node_modules/@stdlib/strided/common/examples/addon-napi-polymorphic/index.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,13 @@
1818

1919
'use strict';
2020

21+
var join = require( 'path' ).join;
22+
var tryRequire = require( '@stdlib/utils/try-require' );
2123
var Float64Array = require( '@stdlib/array/float64' );
2224
var Float32Array = require( '@stdlib/array/float32' ); // eslint-disable-line stdlib/require-last-path-relative
2325

24-
var add;
25-
2626
// Try loading the add-on:
27-
try {
28-
add = require( './addon.node' );
29-
} catch ( err ) {
30-
add = err;
31-
}
27+
var add = tryRequire( join( __dirname, 'addon.node' ) );
3228

3329
/**
3430
* Main execution sequence.

0 commit comments

Comments
 (0)