Skip to content

Commit 51e8135

Browse files
dignifiedquiredaviddias
authored andcommitted
Async Crypto Endeavour (#12)
* refactor: update deps and better browser compat * Using string instead of buffer for proto file * ready
1 parent 6ef269b commit 51e8135

15 files changed

+65
-46
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,3 @@ node_modules
3333
.node_repl_history
3434

3535
dist
36-
lib

.travis.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
sudo: false
22
language: node_js
3-
node_js:
4-
- 4
5-
- 5
3+
matrix:
4+
include:
5+
- node_js: 4
6+
env: CXX=g++-4.8
7+
- node_js: 6
8+
env:
9+
- SAUCE=true
10+
- CXX=g++-4.8
11+
- node_js: stable
12+
env: CXX=g++-4.8
613

714
# Make sure we have new NPM.
815
before_install:
@@ -13,12 +20,17 @@ script:
1320
- npm test
1421
- npm run coverage
1522

16-
addons:
17-
firefox: 'latest'
18-
1923
before_script:
2024
- export DISPLAY=:99.0
2125
- sh -e /etc/init.d/xvfb start
2226

2327
after_success:
2428
- npm run coverage-publish
29+
30+
addons:
31+
firefox: 'latest'
32+
apt:
33+
sources:
34+
- ubuntu-toolchain-r-test
35+
packages:
36+
- g++-4.8

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
[![Coverage Status](https://coveralls.io/repos/github/ipfs/js-ipfs-unixfs/badge.svg?branch=master)](https://coveralls.io/github/ipfs/js-ipfs-unixfs?branch=master)
99
[![Dependency Status](https://david-dm.org/ipfs/js-ipfs-unixfs.svg?style=flat-square)](https://david-dm.org/ipfs/js-ipfs-unixfs)
1010
[![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/js-ipfs-unixfs.svg)](https://saucelabs.com/u/js-ipfs-unixfs)
1115

1216
> JavaScript implementation of IPFS' unixfs (a Unix FileSystem representation on top of a MerkleDAG)
1317

package.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
"name": "ipfs-unixfs",
33
"version": "0.1.4",
44
"description": "JavaScript implementation of IPFS' unixfs (a Unix FileSystem representation on top of a MerkleDAG)",
5-
"main": "lib/index.js",
6-
"jsnext:main": "src/index.js",
5+
"main": "src/index.js",
6+
"browser": {
7+
"fs": false
8+
},
79
"scripts": {
810
"test": "aegir-test",
911
"test:node": "aegir-test node",
@@ -28,14 +30,17 @@
2830
"bugs": {
2931
"url": "https://github.com/ipfs/js-ipfs-unixfs/issues"
3032
},
33+
"engines": {
34+
"node": ">=4.0.0"
35+
},
3136
"homepage": "https://github.com/ipfs/js-ipfs-unixfs#readme",
3237
"devDependencies": {
33-
"aegir": "^2.1.1",
38+
"aegir": "^9.1.0",
3439
"chai": "^3.5.0",
35-
"pre-commit": "^1.1.2"
40+
"pre-commit": "^1.1.3"
3641
},
3742
"dependencies": {
38-
"protocol-buffers": "^3.1.5"
43+
"protocol-buffers": "^3.1.6"
3944
},
4045
"pre-commit": [
4146
"lint",

protos/unixfs.proto

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
'use strict'
22

3-
const fs = require('fs')
4-
const path = require('path')
53
const protobuf = require('protocol-buffers')
6-
const schema = fs.readFileSync(path.resolve(__dirname, '../protos/unixfs.proto'))
7-
const pb = protobuf(schema)
4+
const pb = protobuf(require('./unixfs.proto'))
85
// encode/decode
96
const unixfsData = pb.Data
107
// const unixfsMetadata = pb.MetaData // encode/decode

src/unixfs.proto.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
'use strict'
2+
3+
module.exports = `message Data {
4+
enum DataType {
5+
Raw = 0;
6+
Directory = 1;
7+
File = 2;
8+
Metadata = 3;
9+
Symlink = 4;
10+
}
11+
12+
required DataType Type = 1;
13+
optional bytes Data = 2;
14+
optional uint64 filesize = 3;
15+
repeated uint64 blocksizes = 4;
16+
}
17+
18+
message Metadata {
19+
required string MimeType = 1;
20+
}`
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)