title: How to set puppeteer browser to variable?
body: <p>I try to launch one browser and use it as it need, but i don't know how to set it to variable.</p>
  
  <pre><code>// return promise
  puppeteer.launch()
  </code></pre>
  
  <p>this : </p>
  
  <pre><code>// It's not working
  let bro;
  puppeteer.launch()
      .then(res =&gt; bro = res);
  </code></pre>
  
  <p>this: </p>
  
  <pre><code>//It's not working too
  let bro;
  puppeteer.launch()
      .then(res =&gt; bro = res);
  while (bro === undefined) {
  
  }
  bro.newPage();
  </code></pre>
  
  <p>please tell me how to launch browser once and use it as need : </p>
  
  <pre><code>//
  let bro
  // launch browser
  bro.newPage()
  ...
  </code></pre>
  
  <p>For example in react i can call async function </p>
  
  <pre><code>axios.post("/postOnePage", data)
                      .then(res =&gt; {
                          this.setState({onePageCount: res.data.wordCount});
                      })
                      .catch(err =&gt; console.log(err))
  </code></pre>
  
  <p>set result to variable and use it as it need </p>