Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/cyan33/codec
- Owner: cyan33
- License: mit
- Created: 2017-09-21T18:51:32.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-25T16:55:49.000Z (about 7 years ago)
- Last Synced: 2024-10-01T13:49:04.162Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# codec
:fax: A light codec implemented in JavaScript, aimed for both browser and node.jsIt 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'
```