Skip to content

Latest commit

 

History

History
 
 

quick-start_onnxruntime-node-bundler

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Quick Start - Node (using bundler)

This example is a demonstration of basic usage of ONNX Runtime Node, using a bundler.

A bundler is a tool that puts your code and all its dependencies together in one JavaScript file. In this example, we use webpack to pack our code, and comsume the generated bundle.js in our HTML.

When using webpack on nodejs modules it is not common to include modules like onnxruntime in the bundle since that results in bloat of the bundle and defeats the purpose of the npm package management. For that reason this example uses webpack-node-externals to exclude it from the package.

Usage

  1. install dependencies:

    npm install
  2. use webpack to make bundle:

    npm run build

    this generates the bundle file ./dist/main.js

  3. run with

    node dist/main.js