function main(projectId) {
  // [START compute_firewall_list]
  /**
   * TODO(developer): Uncomment and replace these variables before running the sample.
   */
  // const projectId = 'YOUR_PROJECT_ID';

  const compute = require('@google-cloud/compute');

  async function listFirewallRules() {
    const firewallsClient = new compute.FirewallsClient();

    const [firewallRules] = await firewallsClient.list({
      project: projectId,
    });

    for (const rule of firewallRules) {
      console.log(` - ${rule.name}: ${rule.description}`);
    }
  }

  listFirewallRules();
  // [END compute_firewall_list]
}
Prints a list of all firewall rules in specified project.

@param {string} projectId - project ID or project number of the Cloud project you want to use.