Skip to content

Commit

Permalink
add JS usage info
Browse files Browse the repository at this point in the history
  • Loading branch information
ChlodAlejandro committed Jul 10, 2021
1 parent 59f9baf commit d85844c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ import WikimediaStream from "wikimedia-streams";
const stream = new WikimediaStream("recentchange");
```

If you're using plain JavaScript, you'll need to add `.default` after `require()`.
```ts
const WikimediaStream = require("wikimedia-streams").default;
const stream = new WikimediaStream("recentchange");
```

From here, you can listen to sent events using `.on`.

```ts
Expand Down

0 comments on commit d85844c

Please sign in to comment.