code: def generate_node_command(command, command_opts, path):
      
      if which(NPX_BIN):
          # Use npx if available (npm v5.2+)
          LOGGER.debug("Using npx to invoke %s.", command)
          if platform.system().lower() == 'windows':
              cmd_list = [NPX_BIN,
                          '-c',
                          "%s %s" % (command, ' '.join(command_opts))]
          else:
              # The nested app-through-npx-via-subprocess command invocation
              # requires this redundant quoting
              cmd_list = [NPX_BIN,
                          '-c',
                          "''%s %s''" % (command, ' '.join(command_opts))]
      else:
          LOGGER.debug('npx not found; falling back invoking %s shell script '
                       'directly.', command)
          cmd_list = [
              os.path.join(path,
                           'node_modules',
                           '.bin',
                           command)
          ] + command_opts
      return cmd_list
docs: Return node bin command list for subprocess execution.