Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aikoven/ice-dump
Encode and decode ZeroC Ice objects manually into Ice binary format.
https://github.com/aikoven/ice-dump
Last synced: 3 days ago
JSON representation
Encode and decode ZeroC Ice objects manually into Ice binary format.
- Host: GitHub
- URL: https://github.com/aikoven/ice-dump
- Owner: aikoven
- Created: 2017-03-21T13:40:33.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T04:02:25.000Z (almost 2 years ago)
- Last Synced: 2024-04-14T19:41:47.756Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 686 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ice Dump [![npm version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]
Encode and decode ZeroC Ice values manually into Ice binary format.
## Installation
```bash
npm install ice-dump
```## Usage
Serializing instances of Ice.Value:
```js
import {valueToBuffer, bufferToValue} from 'ice-dump';const buffer = valueToBuffer(iceValue); // Uint8Array
const readValue = bufferToValue(buffer);
```Using Sliced format:
```js
import {Ice} from 'ice';const buffer = valueToBuffer(iceValue, Ice.FormatType.SlicedFormat);
```If you need to deal with proxies, pass `Communicator` as a second parameter to
`bufferToValue`.To serialize structs, sequences or dictionaries you must provide Ice type name
in form `MyModule.MySeq` or `::MyModule::MySeq`:```js
import {iceToBuffer, bufferToIce} from 'ice-dump';const buffer = iceToBuffer(sequence, 'MyModule.MySeq'); // Uint8Array
const readSequence = bufferToIce(buffer, 'MyModule.MySeq');
```[npm-image]: https://badge.fury.io/js/ice-dump.svg
[npm-url]: https://badge.fury.io/js/ice-dump
[travis-image]: https://travis-ci.org/aikoven/ice-dump.svg?branch=master
[travis-url]: https://travis-ci.org/aikoven/ice-dump