Skip to content

Commit

Permalink
[docs] Add an example with ES6 import in the README (#1138)
Browse files Browse the repository at this point in the history
  • Loading branch information
darrachequesne committed Jun 23, 2017
1 parent 19f2b19 commit e9ebe36
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,16 @@ serve the file `socket.io.js` found in the `dist` folder.
</script>
```

```js
// with ES6 import
import io from 'socket.io-client';

const socket = io('http://localhost');
```

A slim build (without `JSON3`, a JSON polyfill for IE6/IE7, and `debug`) is also available: `socket.io.slim.js`.

Socket.IO is compatible with [browserify](http://browserify.org/).
Socket.IO is compatible with [browserify](http://browserify.org/) and [webpack](https://webpack.js.org/) (see example [there](https://github.com/socketio/socket.io/tree/2.0.3/examples/webpack-build)).

### Node.JS (server-side usage)

Expand Down

0 comments on commit e9ebe36

Please sign in to comment.