legacy-encoding
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "legacy-encoding", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Support as many legacy encodings as possible", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -14,3 +14,3 @@ # legacy-encoding | ||
### `legacy.encode(encoding, input, options)` | ||
### `legacy.encode(input, encoding, options)` | ||
@@ -22,3 +22,3 @@ This function takes a plain text string (the `input` parameter) and encodes it acording the `encoding`. The return value is a 'byte string', i.e. a string of which each item represents an octet as per `encoding`. | ||
var encodedData = legacy.encode(encoding, text); | ||
var encodedData = legacy.encode(text, encoding); | ||
``` | ||
@@ -31,3 +31,3 @@ | ||
var encodedData = legacy.encode(text, { | ||
var encodedData = legacy.encode(text, encoding, { | ||
'mode': 'html' | ||
@@ -44,6 +44,6 @@ }); | ||
var buf = new Buffer(legacy.encode(encoding, text), 'binary'); | ||
var buf = new Buffer(legacy.encode(text, encoding), 'binary'); | ||
``` | ||
### `legacy.decode(encoding, input, options)` | ||
### `legacy.decode(input, encoding, options)` | ||
@@ -55,3 +55,3 @@ This function takes a byte string (the `input` parameter) and decodes it according to `encoding`. | ||
var text = legacy.decode(encoding, encodedData); | ||
var text = legacy.decode(encodedData, encoding); | ||
``` | ||
@@ -62,3 +62,3 @@ | ||
```js | ||
var text = windows1255.decode(encoding, encodedData, { | ||
var text = windows1255.decode(encodedData, encoding, { | ||
'mode': 'fatal' | ||
@@ -75,3 +75,3 @@ }); | ||
var text = legacy.decode(encoding, buf.toString('binary')); | ||
var text = legacy.decode(buf.toString('binary'), encoding); | ||
``` | ||
@@ -78,0 +78,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
11156