byte-length

WebJar for byte-length

Лицензия

Лицензия

MIT
Группа

Группа

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

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

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

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

1.0.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

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

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

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

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

https://github.com/DylanPiercey/byte-length

Скачать byte-length

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

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

Зависимости

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

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

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


Byte-Length
API Stability TypeScript Styled with prettier Build status Test Coverage NPM Version Downloads Browser Bundle Size

Calculate the real byte length of any string.

Why

In node many will use Buffer.byteLength, however including the entire buffer shim in the browser just for getting the byte length of a string is not very conservative.

Installation

npm install byte-length

Example

import { byteLength } from "byte-length";

byteLength("hello"); //-> 5
byteLength("😀"); //-> 4
byteLength("fullwidth characters"); //-> 60

Contributions

  • Use npm test to run tests.

Please feel free to create a PR!

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

Версия
1.0.2