braid-http 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -7,6 +7,6 @@ var client = require('./braid-http-client'),
7
7
 
8
8
  module.exports = {
9
9
  fetch: client.fetch,
10
- http: client.http,
10
+ http_client: client.http,
11
11
  http_server: server
12
12
  }
package/index.mjs CHANGED
@@ -8,8 +8,8 @@ import braid_client from './braid-http-client.js'
8
8
  import braid_server from './braid-http-server.js'
9
9
 
10
10
  var fetch = braid_client.fetch,
11
- http = braid_client.http,
11
+ http_client = braid_client.http,
12
12
  http_server = braid_server
13
13
 
14
- export { fetch, http, http_server }
15
- export default { fetch, http, http_server }
14
+ export { fetch, http_client, http_server }
15
+ export default { fetch, http_client, http_server }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braid-http",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "An implementation of Braid-HTTP for Node.js and Browsers",
5
5
  "scripts": {
6
6
  "test": "node test/server.js"
package/readme.md CHANGED
@@ -19,12 +19,14 @@ Node.js:
19
19
  npm install braid-http
20
20
  ```
21
21
 
22
- Then in your node.js code:
23
-
24
22
  ```javascript
23
+ // Import with require()
25
24
  require('braid-http').fetch // A polyfill for require('node-fetch')
26
- require('braid-http').http // A polyfill for require('http') clients
25
+ require('braid-http').http_client // A polyfill for require('http') clients
27
26
  require('braid-http').http_server // A polyfill for require('http') servers
27
+
28
+ // Or as es6 module
29
+ import {fetch, http_client, http_server} from 'braid-http'
28
30
  ```
29
31
 
30
32
  ## Using it in Browsers
@@ -201,10 +203,10 @@ require('http').createServer(app).listen(8583)
201
203
  // Use this line if necessary for self-signed certs
202
204
  // process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0
203
205
 
204
- var https = require('braid-http').http(require('https'))
206
+ var https = require('braid-http').http_client(require('https'))
205
207
  // or:
206
208
  // import braid_http from 'braid-http'
207
- // https = braid_http.http(require('https'))
209
+ // https = braid_http.http_client(require('https'))
208
210
 
209
211
  https.get(
210
212
  'https://braid.org/chat',