Skip to content
This repository was archived by the owner on Aug 24, 2021. It is now read-only.

Commit eb0b683

Browse files
dignifiedquiredaviddias
authored andcommitted
feat: async-crypto + aegir 9 + sauce labs testing
1 parent 99fa36b commit eb0b683

File tree

5 files changed

+37
-27
lines changed

5 files changed

+37
-27
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,3 @@ build/Release
2727
node_modules
2828

2929
dist
30-
lib

.travis.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
sudo: false
22
language: node_js
3-
node_js:
4-
- 4
5-
- 5
6-
- stable
73

8-
# Make sure we have new NPM.
4+
matrix:
5+
include:
6+
- node_js: 4
7+
env: CXX=g++-4.8
8+
- node_js: 6
9+
env:
10+
- SAUCE=true
11+
- CXX=g++-4.8
12+
- node_js: stable
13+
env: CXX=g++-4.8
14+
915
before_install:
1016
- npm install -g npm
1117

@@ -21,11 +27,8 @@ before_script:
2127
after_success:
2228
- npm run coverage-publish
2329

24-
env:
25-
- CXX=g++-4.8
26-
2730
addons:
28-
firefox: 'latest'
31+
firefox: latest
2932
apt:
3033
sources:
3134
- ubuntu-toolchain-r-test

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
[![Travis CI](https://travis-ci.org/multiformats/js-multihashing-async.svg?branch=master)](https://travis-ci.org/multiformats/js-multihashing-async)
99
[![Circle CI](https://circleci.com/gh/multiformats/js-multihashing-async.svg?style=svg)](https://circleci.com/gh/multiformats/js-multihashing-async)
1010
[![Dependency Status](https://david-dm.org/multiformats/js-multihashing-async.svg?style=flat-square)](https://david-dm.org/multiformats/js-multihashing-async) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)
11+
![](https://img.shields.io/badge/npm-%3E%3D3.0.0-orange.svg?style=flat-square)
12+
![](https://img.shields.io/badge/Node.js-%3E%3D4.0.0-orange.svg?style=flat-square)
13+
14+
[![Sauce Test Status](https://saucelabs.com/browser-matrix/ipfs-js-mh-async.svg)](https://saucelabs.com/u/ipfs-js-mh-async)
1115

1216
> Use all the functions in [multihash](https://github.com/multiformats/multihash).
1317

package.json

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,18 @@
22
"name": "multihashing-async",
33
"version": "0.1.0",
44
"description": "multiple hash functions",
5-
"main": "lib/index.js",
6-
"jsnext:main": "src/index.js",
5+
"main": "src/index.js",
76
"browser": {
8-
"./src/crypto.js": "./src/crypto-browser.js",
9-
"./lib/crypto.js": "./lib/crypto-browser.js"
7+
"./src/crypto.js": "./src/crypto-browser.js"
108
},
119
"scripts": {
12-
"test": "PHANTOM=off aegir-test",
13-
"test:browser": "PHANTOM=off aegir-test browser",
10+
"test": "aegir-test",
11+
"test:browser": "aegir-test browser",
1412
"test:node": "aegir-test node",
1513
"lint": "aegir-lint",
16-
"release": "PHANTOM=off aegir-release",
17-
"release-minor": "PHANTOM=off aegir-release minor",
18-
"release-major": "PHANTOM=off aegir-release major",
14+
"release": "aegir-release",
15+
"release-minor": "aegir-release minor",
16+
"release-major": "aegir-release major",
1917
"build": "aegir-build",
2018
"coverage": "aegir-coverage",
2119
"coverage-publish": "aegir-coverage publish",
@@ -39,14 +37,18 @@
3937
},
4038
"dependencies": {
4139
"browserify-sha3": "0.0.2",
42-
"multihashes": "^0.2.0",
40+
"multihashes": "^0.2.2",
41+
"nodeify": "^1.0.0",
4342
"sha3": "^1.2.0"
4443
},
4544
"devDependencies": {
46-
"aegir": "^8.1.0",
47-
"benchmark": "^2.1.1",
45+
"aegir": "^9.0.1",
46+
"benchmark": "^2.1.2",
4847
"chai": "^3.5.0",
49-
"pre-commit": "^1.1.2"
48+
"pre-commit": "^1.1.3"
49+
},
50+
"engines": {
51+
"node": ">=4.0.0"
5052
},
5153
"homepage": "https://github.com/multiformats/js-multihashing-async",
5254
"contributors": [
@@ -58,4 +60,4 @@
5860
"Richard Littauer <[email protected]>",
5961
"npm-to-cdn-bot (by Forbes Lindesay) <[email protected]>"
6062
]
61-
}
63+
}

src/crypto-browser.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict'
22

33
const SHA3 = require('browserify-sha3')
4+
const nodeify = require('nodeify')
45

56
const webCrypto = getWebCrypto()
67

@@ -34,9 +35,10 @@ function webCryptoHash (type) {
3435
return
3536
}
3637

37-
return res.then((arrbuf) => {
38-
callback(null, new Buffer(new Uint8Array(arrbuf)))
39-
}).catch((err) => callback(err))
38+
nodeify(
39+
res.then((raw) => new Buffer(new Uint8Array(raw))),
40+
callback
41+
)
4042
}
4143
}
4244

0 commit comments

Comments
 (0)