Skip to content

Commit

Permalink
doc: basic docs for esm support
Browse files Browse the repository at this point in the history
  • Loading branch information
MylesBorins committed Apr 5, 2019
1 parent b76a293 commit e0a95dc
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,25 @@ oscServer.on('message', function (msg) {
});
```

### Now with ESM!

```js
import { Client, Server } from 'node-osc/esm.mjs'

const client = new Client('127.0.0.1', 3333);
var server = new Server(3333, '0.0.0.0');

server.on('message', function (msg) {
console.log(`Message: ${msg}`);
server.close();
});

client.send('/hello', 'world', (err) => {
if (err) console.error(err);
client.close();
});
```

## License

LGPL. Please see the file lesser.txt for details.

0 comments on commit e0a95dc

Please sign in to comment.