Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "coap", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "A CoAP library for node modelled after 'http'", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -77,2 +77,4 @@ node-coap | ||
* <a href="#outgoing"><code>OutgoingMessage</b></code></a> | ||
* <a href="#registerOption"><code>coap.registerOption()</b></code></a> | ||
* <a href="#registerFormat"><code>coap.registerFormat()</b></code></a> | ||
@@ -218,3 +220,3 @@ <a name="request"></a> | ||
`'Content-Format'`, `'Accept'` and `'ETag'`. | ||
See <a href='#registerOption'> to know how to register more. | ||
See <a href='#registerOption'><code>registerOption()</code></a> to know how to register more. | ||
@@ -251,2 +253,18 @@ See the | ||
<a name="registerOption"></a> | ||
### coap.registerOption(name, toBinary, toString) | ||
Register a new option to be converted to string and added to the | ||
`message.headers`. | ||
`toBinary` is a function that accept a string and returns a `Buffer`. | ||
`toString` is a function that accept a `Buffer` and returns a `String`. | ||
<a name="registerFormat"></a> | ||
### coap.registerFormat(name, value) | ||
Register a new format to be interpreted and sent in CoAP | ||
`Content-Format` option. | ||
Each format is identified by a number, see the [Content-Format | ||
registry](http://tools.ietf.org/html/draft-ietf-core-coap-18#section-12.3). | ||
<a name="contributing"></a> | ||
@@ -261,2 +279,12 @@ ## Contributing | ||
These are the defaults formats: | ||
```js | ||
registerFormat('text/plain', 0) | ||
registerFormat('application/link-format', 40) | ||
registerFormat('application/xml', 41) | ||
registerFormat('application/octet-stream', 42) | ||
registerFormat('application/exi', 47) | ||
registerFormat('application/json', 50) | ||
``` | ||
## Limitations | ||
@@ -263,0 +291,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
50743
313
4