codecs

WebJar for codecs

Лицензия

Лицензия

MIT
Группа

Группа

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

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

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

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

2.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

codecs
WebJar for codecs
Ссылка на сайт

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

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

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

https://github.com/mafintosh/codecs

Скачать codecs

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

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

Зависимости

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

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

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

codecs

Create an binary encoder/decoder for Node's build in types like, json, utf-8, hex.

npm install codecs

Build Status

Useful to support value encodings similar to leveldb's.

Usage

var codecs = require('codecs')
var json = codecs('json')

console.log(json.encode({hello: 'world'})) // new Buffer('{"hello":"world"}')
console.log(json.decode(new Buffer('{"hello":"world"}'))) // {hello: 'world'}

API

var codec = codecs(type)

Create a new codec.

Supported types are

  • utf8
  • json
  • ndjson
  • binary
  • hex
  • ascii
  • base64
  • ucs2
  • ucs-2
  • utf16le
  • utf-16le
  • binary

If an unknown type is passed in binary is used. If you want to use a custom codec you can pass in an object containing a an encode and decode method and that will be returned.

var buf = codec.encode(value)

Encode a value to a buffer.

var value = codec.decode(buf)

Decode a buffer to a value.

License

MIT

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

Версия
2.0.0