message: Promisify waiting for new runtime.
diff: @@ -2,6 +2,7 @@ import * as loader from "@prague/loader";
  import { IMap } from "@prague/map";
  import {
  IDocumentService,
  + IRuntime,
  ITokenProvider,
  IUser,
  } from "@prague/runtime-definitions";
  @@ -17,7 +18,6 @@ import { NodePlatformFactory } from "./nodePlatformFactory";
  const rootMapId = "root";
  // tslint:disable:no-unsafe-any
  -
  async function readlineAsync(input: readline.ReadLine, prompt: string): Promise<string> {
  return new Promise<string>((resolve) => {
  // tslint:disable-next-line:no-unnecessary-callback-wrapper
  @@ -25,6 +25,14 @@ async function readlineAsync(input: readline.ReadLine, prompt: string): Promise<
  });
  }
  +async function waitForNewRuntime(document: loader.Document) {
  + return new Promise<IRuntime>((resolve, reject) => {
  + document.on("runtimeChanged", (newRuntime: IRuntime) => {
  + resolve(newRuntime);
  + });
  + });
  +}
  +
  async function run(
  id: string,
  tenantId: string,
  @@ -44,7 +52,10 @@ async function run(
  ora.promise(documentP, `Loading ${tenantId}/${id}`);
  const document = await documentP;
  - document.on("runtimeChanged", async (newRuntime) => {
  + const newRuntimeP = waitForNewRuntime(document);
  + ora.promise(newRuntimeP, `Waiting for new runtime\n`);
  + const newRuntime = await newRuntimeP;
  +
  const root = await newRuntime.getChannel(rootMapId) as IMap;
  const rootView = await root.getView();
  @@ -64,11 +75,11 @@ async function run(
  // tslint:disable no-backbone-get-set-outside-model
  const clicks = Number(rootView.get("clicks"));
  rootView.set("clicks", clicks + parsedValue);
  + console.log(`New value: ${rootView.get("clicks")}`);
  } catch {
  console.log(`Only integer value is allowed`);
  }
  }
  - });
  }
  // Process command line input
  