Skip to content

Commit

Permalink
Update README with documentation section
Browse files Browse the repository at this point in the history
  • Loading branch information
N2D4 committed Apr 4, 2024
1 parent 88c303e commit d782ea2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npm install pgmock
If you'd like to run `pgmock` in a browser, see the [Browser support](#browser-support) section for detailed instructions.

## Getting started
After `npm install pgmock`, you can run an in-memory server like so:
You can run an in-memory server like so:

```typescript
import { PostgresMock } from "pgmock";
Expand All @@ -42,6 +42,10 @@ It is considered good practice to destroy the mock server after you are done wit
mock.destroy();
```

## Documentation

Check the [PostgresMock source file](https://github.com/stackframe-projects/pgmock/blob/main/src/postgres-mock.ts) for a list of all available methods and their documentation.

## Browser support

`pgmock` fully supports browser environments. While webapps can't listen to TCP ports, you can still use `PostgresMock.createSocket` and the `node-postgres` configuration. However, if your bundler statically analyzes imports, the default configuration may show a warning because of missing (optional) Node.js modules. Check `examples/web-demo/next.config.mjs` for an example on how to configure Webpack for bundling.
Expand Down

0 comments on commit d782ea2

Please sign in to comment.