Skip to content

Commit 1fb6289

Browse files
author
v1rtl
committed
update readme
1 parent 7a26032 commit 1fb6289

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ See [solc-js README](https://github.com/ethereum/solc-js#readme) and [Deno doc](
1919
## Example
2020

2121
```ts
22-
import { setupSolc } from 'https://deno.land/x/solc/mod.ts'
22+
import { wrapper } from 'https://deno.land/x/solc/mod.ts'
2323
import { Input } from 'https://deno.land/x/solc/types.ts'
2424
import { download } from 'https://deno.land/x/solc/download.ts'
25+
import { createRequire } from 'https://deno.land/[email protected]/node/module.ts'
2526

2627
const exists = async (filename: string): Promise<boolean> => {
2728
try {
@@ -40,7 +41,8 @@ if (!(await exists('./soljson.js'))) await download('./soljson.js')
4041

4142
const dec = new TextDecoder()
4243

43-
const solc = setupSolc('./soljson.js')
44+
const require = createRequire(import.meta.url)
45+
const solc = wrapper(require('./soljson.js'))
4446

4547
const readFile = async (path: string) => {
4648
const file = await Deno.readFile(path)

0 commit comments

Comments
 (0)