Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["airbnb"]
}
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["airbnb"]
}
74 changes: 74 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless

.idea/
*.iml
data/
out/
lib/
# .vscode/
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules/
/src/
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- 4
- 5
- 6
script: node test.js
- node
before_script:
- npm run build
script: npm run test
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
binn.js
=======
[![Build Status](https://travis-ci.org/liteserver/binn.js.svg?branch=master)](https://travis-ci.org/liteserver/binn.js)
[![Build Status](https://travis-ci.org/MintT-SA/binn.js.svg?branch=master)](https://travis-ci.org/MintT-SA/binn.js)
[![Deps](https://img.shields.io/badge/dependencies-none-brightgreen.svg)]()

Binary serialization using the Binn format.
Expand All @@ -16,20 +16,22 @@ Usage
Header

```javascript
var binn = require('binn.js');
import { encode, decode } from 'binn.js';
// Or with require
const { encode, decode } = require('binn.js');
```

Encoding

```javascript
var obj = {hello: 'world', number: 123};
var data = binn.encode(obj);
const obj = { hello: 'world', number: 123 };
const data = encode(obj);
```

Decoding

```javascript
var obj = binn.decode(data);
const obj = decode(data);
```

Undefined
Expand Down
Loading