-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a564c2a
commit f7d4e76
Showing
8 changed files
with
2,267 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,3 +57,6 @@ typings/ | |
# dotenv environment variables file | ||
.env | ||
|
||
/dist | ||
|
||
.npmrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/* | ||
!/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import * as WebSocket from 'ws'; | ||
import { Client } from './src/Client'; | ||
|
||
const c = new Client({ | ||
make(address: string): WebSocket { | ||
return new WebSocket(address); | ||
} | ||
}); | ||
|
||
c.connect(); | ||
c.getSocket().on('data', console.log); | ||
c.on('error', console.error); | ||
c.on('connect', () => { | ||
c.setIncludeDetectors(false); | ||
c.setArea({ | ||
latitude: 55.5, | ||
longitude: 2, | ||
}, | ||
{ | ||
latitude: 45.3, | ||
longitude: 18, | ||
}); | ||
}) | ||
c.on('data', strike => console.log(strike)); |
Oops, something went wrong.