Replicate demo/run.js examples with promises