Created
April 17, 2016 17:02
-
-
Save l0s/dc4ef7a7de9f1399ae1db0142fc934a8 to your computer and use it in GitHub Desktop.
Compile Solidity from UNIX command line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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