Skip to content

Commit 2b9e51c

Browse files
authored
Merge pull request #197 from ethereum/docs
Document compileStandardWrapper
2 parents dc0f4e8 + 8859ac9 commit 2b9e51c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,17 @@ The `compile()` method always returns an object, which can contain `errors`, `so
8989

9090
Starting from version 0.4.11 there is a new entry point named `compileStandardWrapper()` which supports Solidity's [standard JSON input and output](https://solidity.readthedocs.io/en/develop/using-the-compiler.html#compiler-input-and-output-json-description). It also maps old compiler output to it.
9191

92+
```javascript
93+
var solc = require('solc')
94+
95+
// 'input' is a JSON string corresponding to the "standard JSON input" as described in the link above
96+
// 'findImports' works as described above
97+
var output = solc.compileStandardWrapper(input, findImports)
98+
// Ouput is a JSON string corresponding to the "standard JSON output"
99+
```
100+
101+
There is also a direct method, `compileStandard`, which is only present on recent compilers and works the same way. `compileStandardWrapper` is preferred however because it provides the same interface for old compilers.
102+
92103
#### From version 0.4.20
93104

94105
Starting from version 0.4.20 a Semver compatible version number can be retrieved on every compiler release, including old ones, using the `semver()` method.

0 commit comments

Comments
 (0)