Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
krzkaczor committed Nov 7, 2019
1 parent 9ed131b commit b3f8974
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,26 @@ Furthermore, we will silent tslint for generated files with `/* tslint:disable *
You may want to use `ts-generator` api to kick off whole process by api:

```typescript
import { tsGen } from "ts-generator";
import { Typechain } from "typechain";
import { tsGenerator } from "ts-generator";
import { TypeChain } from "typechain/dist/TypeChain";

async function main() {
await tsGen(
const cwd = process.cwd();

await tsGenerator(
{ cwd },
new Typechain({ cwd, rawConfig: { files: "your-glob-here", outDir: "optional out dir path" } }),
new TypeChain({
cwd,
rawConfig: {
files: "your-glob-here",
outDir: "optional out dir path",
target: "your-target",
},
}),
);
}

main().catch(console.error);
```

### Running tests
Expand Down

0 comments on commit b3f8974

Please sign in to comment.