require-solidity
v1.0.0
Published
This module can be used
Downloads
3
Readme
Require solidity
This module can be used
- a browserify transform when requiring
- to enable node to require sol files
- to compile files ahead of time
For browserify
In your client js simply require solidity files such as
// in client_side.js
var contractinfo = require("./contract.sol");
Then add the module as a transform as normal
var b = browserify();
b.add("/client_side.js");
b.transform(require("require-solidity"));
b.bundle();
For node
require("require-solidity").bindToRequire();
var contractinfo = require("./contract.sol");
or you can use it directly
const requireSol = require("require-solidity");
var contractinfo = requireSol("./contract.sol");
For compiling
$ compile-sol ./path/to/inputfile.sol
Will echo out to the stdout
or you can send it to an output file
$ compile-sol ./path/to/inputfile.sol ./path/to/output.json