function read() {
  const line = system.stdin.readLine();
  if (line) {
    if (line === NOOP) {
      system.stdout.writeLine(`>${NOOP}`);
      setTimeout(read, 100);
      return;
    }
    const command = JSON.parse(line, (key, value) => {
      if (
        value
        && typeof value === 'string'
        && value.substr(0, 8) === 'function'
        && value.indexOf('[native code]') === -1
      ) {
        const startBody = value.indexOf('{') + 1;
        const endBody = value.lastIndexOf('}');
        const startArgs = value.indexOf('(') + 1;
        const endArgs = value.indexOf(')');

        // eslint-disable-next-line no-new-func
        return new Function(
          value.substring(startArgs, endArgs),
          value.substring(startBody, endBody),
        );
      }
      return value;
    });

    // Call here to look for transform key
    transform(command.params);

    try {
      executeCommand(command);
    } catch (e) {
      command.error = e.message;
      completeCommand(command);
    } finally {
      setTimeout(read, 0);
    }
  }
}
Calls readLine() and blocks until a message is ready