utf8-byte-length

WebJar for utf8-byte-length

Лицензия

Лицензия

Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

utf8-byte-length
Последняя версия

Последняя версия

1.0.4
Дата

Дата

Тип

Тип

jar
Описание

Описание

utf8-byte-length
WebJar for utf8-byte-length
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/parshap/utf8-byte-length

Скачать utf8-byte-length

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/utf8-byte-length/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>utf8-byte-length</artifactId>
    <version>1.0.4</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/utf8-byte-length/
implementation 'org.webjars.npm:utf8-byte-length:1.0.4'
// https://jarcasting.com/artifacts/org.webjars.npm/utf8-byte-length/
implementation ("org.webjars.npm:utf8-byte-length:1.0.4")
'org.webjars.npm:utf8-byte-length:jar:1.0.4'
<dependency org="org.webjars.npm" name="utf8-byte-length" rev="1.0.4">
  <artifact name="utf8-byte-length" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='utf8-byte-length', version='1.0.4')
)
libraryDependencies += "org.webjars.npm" % "utf8-byte-length" % "1.0.4"
[org.webjars.npm/utf8-byte-length "1.0.4"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

utf8-byte-length build status

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

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.

Версии библиотеки

Версия
1.0.4