Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cyan33/codec

:fax: A light weight codec implemented in JavaScript, aimed for both browser and node.js
https://github.com/cyan33/codec

Last synced: 27 days ago
JSON representation

:fax: A light weight codec implemented in JavaScript, aimed for both browser and node.js

Awesome Lists containing this project

README

        

# codec
:fax: A light codec implemented in JavaScript, aimed for both browser and node.js

It encode a primitive type to a string, whose length is seven.

## Installation

```
npm install @changyan/codec
```

## Usage

Node,js:

```js
const codec = require('@changyan/codec');
```

ES6:

```js
import codec from '@changyan/codec';
```

In your code, try it out like this:

```js
let key = codec.encode('Hello world'); // 'LLvEUum'

let src = codec.decode(key); // 'Hello world'
```