aboutsummaryrefslogtreecommitdiff
path: root/node_modules/utf8-byte-length/README.md
diff options
context:
space:
mode:
authorPriyansh <[email protected]>2020-12-22 17:49:59 +0530
committerPriyansh <[email protected]>2020-12-22 17:49:59 +0530
commite93da8b04da86773247aadb1cbb1912e4f4526b2 (patch)
treeeb4ef3203a92ed3dbd2252ddb1ea23bd2d670c98 /node_modules/utf8-byte-length/README.md
parenta5743c293dcb435e4b159a4df791f8955a4110ec (diff)
downloadstyx-e93da8b04da86773247aadb1cbb1912e4f4526b2.tar.xz
styx-e93da8b04da86773247aadb1cbb1912e4f4526b2.zip
Rewriting Project
Diffstat (limited to 'node_modules/utf8-byte-length/README.md')
-rw-r--r--node_modules/utf8-byte-length/README.md28
1 files changed, 28 insertions, 0 deletions
diff --git a/node_modules/utf8-byte-length/README.md b/node_modules/utf8-byte-length/README.md
new file mode 100644
index 0000000..a232c12
--- /dev/null
+++ b/node_modules/utf8-byte-length/README.md
@@ -0,0 +1,28 @@
+# utf8-byte-length [![build status](https://secure.travis-ci.org/parshap/utf8-byte-length.svg?branch=master)](http://travis-ci.org/parshap/utf8-byte-length)
+
+Get the utf8 byte length of a string, taking into account multi-byte
+characters and surrogate pairs.
+
+By default, this module defers to `Buffer.byteLength`. A browser
+implementation is also provided that doesn't use `Buffer.byteLength`
+minimize build size.
+
+## Example
+
+```js
+var getLength = require("utf8-byte-length")
+console.log(truncate("a☃", 2)) // a = 1 byte, ☃ = 3 bytes
+// -> 4
+```
+
+## API
+
+### `var getLength = require("utf8-byte-length")`
+
+*When using browserify or webpack*, this automatically resolves to an
+implementation that does not use `Buffer.byteLength`.
+
+### `getLength(string)`
+
+Returns the byte length of `string`. Throws an error if `string` is not
+a string.