title: How to compile solidity using solc 0.5
body: <p>compile.js :</p>
  
  <pre><code>const path = require('path');
  const solc = require('solc');
  const fs = require('fs-extra');
  
  const buildPath = path.resolve(__dirname, 'build');
  fs.removeSync(buildPath);
  
  const campaignPath = path.resolve(__dirname, 'contracts', 'Campaign.sol');
  const source = fs.readFileSync(campaignPath, 'utf8');
  
  var input = {
      language: 'Solidity',
      sources: {
          'Campaign.sol': {
              content: source
          }
      },
      settings: {
          outputSelection: {
              '*': {
                  '*': [ '*' ]
              }
          }
      }
  }
  
  const output = solc.compile(input, 1).contracts;
  
  fs.ensureDirSync(buildPath);
  
  for(let contract in output){
      fs.outputJSONSync(
          path.resolve(buildPath, contract+'.json')
      );
  }
  </code></pre>
  
  <p>Campaign.sol :</p>
  
  <pre><code>pragma solidity ^0.5.3;
  
  contract FactoryCampaign {
      . . .
  }
  
  contract Campaign {
      . . . 
  }
  </code></pre>
  
  <p>The Solidity works perfectly in remix editor and the solc version is 0.5.3</p>
  
  <p>The solc version 0.4 allowed me to call solc.compile on the 'source' directly but the later versions throw this error</p>
  
  <blockquote>
    <p>AssertionError [ERR_ASSERTION]: Invalid callback specified.</p>
  </blockquote>