Skip to content

Instantly share code, notes, and snippets.

@l0s
Created April 17, 2016 17:02
Show Gist options
  • Select an option

  • Save l0s/dc4ef7a7de9f1399ae1db0142fc934a8 to your computer and use it in GitHub Desktop.

Select an option

Save l0s/dc4ef7a7de9f1399ae1db0142fc934a8 to your computer and use it in GitHub Desktop.
Compile Solidity from UNIX command line
// Usage:
// node compile.js <filename.sol>
var fs = require( 'fs' );
var solc = require( 'solc' );
var compile = function( error, data )
{
if( error )
{
console.error( error );
process.exit( 1 );
}
console.log( solc.compile( data, 1 ) );
}
fs.readFile( process.argv[ 2 ], 'utf8', compile );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment