diff --git a/README.md b/README.md index ee1e39278a5..55f77140605 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ web3.eth.getAccounts() ### Usage with TypeScript -We do support types within the repo itself. Please open an issue here if you find any wrong types. +We support types within the repo itself. Please open an issue here if you find any wrong types. You can use `web3.js` as follows: @@ -74,6 +74,15 @@ import Web3 from 'web3'; const web3 = new Web3("ws://localhost:8546"); ``` +If you are using the types in a `commonjs` module like for example a node app you just have to enable `esModuleInterop` in your `tsconfig` compile option, also enable `allowSyntheticDefaultImports` for typesystem compatibility: + +```js +"compilerOptions": { + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + .... +``` + ## Documentation Documentation can be found at [read the docs][docs]