title: Function is not defined | Node.js
body: <p>I have <strong>boleto.js</strong></p>
  
  <pre><code>var axios = require('axios');    
  function getBoleto (token) {
    if (!token) throw Error('Miss Token!');
  
    return axios.get(
      '/boletos',
      {
        params: {
          token: 'token...'
        }
      }
    ).then(res =&gt; {
      //console.log(res.data);
      return res.data;
    })
    .catch(err =&gt; {
      console.log('Error boletos', err);
      })
  }        
  getBoleto()
    .then(boletos =&gt; {
      gravar(boletos, function(err){
          if (err) throw new Error('Error boletos');
      });
    });
  </code></pre>
  
  <p>And <strong>gravar.js</strong></p>
  
  <pre><code>module.exports = function (object, callback) {
  // Save DB
  ...
  console.log('Saved successfully');
  callback();
  }
  </code></pre>
  
  <p>What I need? Save the return of boleto.js in gravar.js</p>
  
  <p>But brought this message :  Reference error: gravar is not defined</p>