example.js: fix example to use up to date API

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>