Socket
Socket
Sign inDemoInstall

level-codec

Package Overview
Dependencies
0
Maintainers
2
Versions
31
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    level-codec

Levelup's encoding logic


Version published
Weekly downloads
441K
decreased by-0.37%
Maintainers
2
Install size
15.4 kB
Created
Weekly downloads
 

Changelog

Source

[7.0.1] - 2017-08-14

Added

  • Add Greenkeeper (#17) (@ralphtheninja)

Fixed

  • Use identity function consistently (#14) (@dcousens)

Readme

Source

level-codec

LevelDB Logo

LevelUP's encoding logic.

Build Status Greenkeeper badge

API

Codec([opts])

Create a new codec, with a global options object.

This could be something like

var codec = new Codec(db.options);

#encodeKey(key[, opts])

Encode key with given opts.

#encodeValue(value[, opts])

Encode value with given opts.

#encodeBatch(batch[, opts])

Encode batch ops with given opts.

#encodeLtgt(ltgt)

Encode the ltgt values of option object ltgt.

#decodeKey(key[, opts])

Decode key with given opts.

#decodeValue(value[, opts])

Decode value with given opts.

#createStreamDecoder([opts])

Create a function with signature (key, value), that for each key/value pair returned from a levelup read stream returns the decoded value to be emitted.

#keyAsBuffer([opts])

Check whether opts and the global opts call for a binary key encoding.

#valueAsBuffer([opts])

Check whether opts and the global opts call for a binary value encoding.

#encodings

The supported encodings as object of form

{
  "name": {
    "encode": Function,
    "decode": Function,
    "buffer": Boolean,
    "type": String
  }
}

Currently supported encodings:

  • utf8
  • json
  • binary
  • hex
  • ascii
  • base64
  • ucs2
  • ucs-2
  • utf16le
  • utf-16le
  • none (bypass level-codec)

Publishers

Copyright (c) 2012-2015 LevelUP contributors.

LevelUP is licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.

FAQs

Last updated on 14 Aug 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc