Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript Quality of Life updates #26

Merged
merged 4 commits into from
Oct 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/py/
/ex/
/build/
/js/__tests__/
.travis.yml
MANIFEST.in
mix.exs
pytest.ini
setup.cfg
setup.py
.gitattributes
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Erlpack

Erlpack is a fast encoder and decoder for the Erlang Term Format (version 131) for Python and Javascript.
Erlpack is a fast encoder and decoder for the Erlang Term Format (version 131) for Python and JavaScript.

# Javascript
# JavaScript

## Things that can be packed:

Expand Down Expand Up @@ -65,7 +65,7 @@ v8::Local<v8::Value> ConvertToNodeBuffer(const v8::Local<v8::Object>& blinkArray
}
```

Then in Javascript something like:
Then in JavaScript something like:

```js
let packed = NativeUtils.convertToNodeBuffer(new Uint8Array(binaryPayload));
Expand Down Expand Up @@ -148,4 +148,4 @@ class User(object):

u = User(name='Jake', age=23)
packed = pack(u)
```
```
4 changes: 4 additions & 0 deletions js/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module 'erlpack' {
export function pack(data: any): Buffer;
export function unpack(data: Buffer): any;
}
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
{
"main": "./js/index.js",
"types": "./js/index.d.ts",
"name": "erlpack",
"version": "0.1.3",
"description": "Erlpack is a fast encoder and decoder for the Erlang Term Format (version 131) for Javascript",
"description": "Erlpack is a fast encoder and decoder for the Erlang Term Format (version 131) for JavaScript",
"scripts": {
"test": "jest"
},
"author": "Jason Citron",
"license": "Apache-2.0",
"license": "MIT",
"dependencies": {
"bindings": "^1.5.0",
"nan": "^2.14.0"
},
"gypfile": true,
"devDependencies": {
"@types/node": "^12.11.7",
"jest-cli": "^24.9.0"
},
"jest": {
Expand Down