I would like to do as described here:
https://cloud.google.com/bigquery/docs/tables#creating_a_table_from_a_query_result
However I'm using the node.js client libraries for which there is no documentation there. Possibly this is not supported by the node.js client libraries, or possibly it's not yet documented for node.js.
===Alternative solution===
An alterative solution, as suggested by @ElliottBrossard is to use the create table statement documented here:
as follows
bigQuery.query({
query: 'CREATE OR REPLACE TABLE `<project_name>.<dataset_name>.<output_table_name>` AS SELECT * FROM `<project_name>.<dataset_name>.<input_table_name>*`',
useLegacySql: false, // Use standard SQL syntax for queries.
})