File tree Expand file tree Collapse file tree 7 files changed +47
-8
lines changed Expand file tree Collapse file tree 7 files changed +47
-8
lines changed Original file line number Diff line number Diff line change @@ -25,3 +25,6 @@ build/Release
25
25
# Dependency directory
26
26
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
27
27
node_modules
28
+
29
+ dist
30
+ lib
Original file line number Diff line number Diff line change
1
+ use_sudo : false
1
2
language : node_js
2
3
node_js :
3
- - " iojs"
4
+ - 4
5
+ - 5
4
6
5
7
branches :
6
8
only :
@@ -10,4 +12,5 @@ before_install:
10
12
- npm i -g npm
11
13
# Workaround for a permissions issue with Travis virtual machine images
12
14
script :
15
+ - npm run lint
13
16
- npm test
Original file line number Diff line number Diff line change
1
+ 'use strict'
2
+
1
3
var Swarm = require ( 'libp2p-swarm' )
2
4
var tcp = require ( 'libp2p-tcp' )
3
5
var multiaddr = require ( 'multiaddr' )
Original file line number Diff line number Diff line change
1
+ 'use strict'
2
+
1
3
var Swarm = require ( 'libp2p-swarm' )
2
4
var tcp = require ( 'libp2p-tcp' )
3
5
var multiaddr = require ( 'multiaddr' )
Original file line number Diff line number Diff line change 2
2
"name" : " libp2p" ,
3
3
"version" : " 0.1.1" ,
4
4
"description" : " Node.js implementation of libp2p" ,
5
- "main" : " src/index.js" ,
5
+ "main" : " lib/index.js" ,
6
+ "jsnext:main" : " src/index.js" ,
6
7
"scripts" : {
7
- "test" : " echo \" Error: no test specified\" && exit 1"
8
+ "lint" : " dignified-lint" ,
9
+ "build" : " dignified-build" ,
10
+ "test" : " dignified-test" ,
11
+ "test:node" : " dignified-test node" ,
12
+ "test:browser" : " dignified-test browser" ,
13
+ "release" : " dignified-release"
8
14
},
9
15
"repository" : {
10
16
"type" : " git" ,
16
22
"engines" : {
17
23
"node" : " ^4.0.0"
18
24
},
19
- "pre-commit" : [],
25
+ "pre-commit" : [
26
+ " lint" ,
27
+ " test"
28
+ ],
20
29
"author" :
" David Dias <[email protected] >" ,
21
30
"license" : " MIT" ,
22
31
"bugs" : {
23
32
"url" : " https://github.com/diasdavid/js-libp2p/issues"
24
33
},
25
34
"homepage" : " https://github.com/diasdavid/js-libp2p" ,
26
35
"devDependencies" : {
27
- "code " : " ^1 .5.0" ,
28
- "lab " : " ^5.17 .0" ,
36
+ "chai " : " ^3 .5.0" ,
37
+ "dignified.js " : " ^1.0 .0" ,
29
38
"libp2p-spdy" : " ^0.1.0" ,
30
39
"libp2p-swarm" : " ^0.5.5" ,
31
40
"libp2p-tcp" : " ^0.1.2" ,
32
41
"multiaddr" : " ^1.1.1" ,
33
42
"peer-id" : " ^0.4.0" ,
34
43
"peer-info" : " ^0.4.0" ,
35
- "pre-commit" : " ^1.1.1" ,
36
- "standard" : " ^5.3.1"
44
+ "pre-commit" : " ^1.1.1"
37
45
}
38
46
}
Original file line number Diff line number Diff line change
1
+ 'use strict'
2
+
1
3
exports = module . exports = Libp2p
2
4
3
5
function Libp2p ( swarm , peerRouting , recordStore ) {
Original file line number Diff line number Diff line change
1
+ /* eslint-env mocha */
2
+ 'use strict'
3
+
4
+ const expect = require ( 'chai' ) . expect
5
+ const Swarm = require ( 'libp2p-swarm' )
6
+ const Id = require ( 'peer-id' )
7
+ const Peer = require ( 'peer-info' )
8
+
9
+ const Node = require ( '../src' )
10
+
11
+ describe ( 'libp2p' , ( ) => {
12
+ it ( 'can be instantiated' , ( ) => {
13
+ const peer = new Peer ( Id . create ( ) , [ ] )
14
+ const swarm = new Swarm ( peer )
15
+ const node = new Node ( swarm )
16
+
17
+ expect ( node . swarm ) . to . be . eql ( swarm )
18
+ } )
19
+ } )
You can’t perform that action at this time.
0 commit comments