diff --git a/.gitignore b/.gitignore index e920c16..3349b6f 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,7 @@ node_modules # Optional REPL history .node_repl_history + +# Dignified.js builds +dist +lib diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..c3c3bbe --- /dev/null +++ b/.npmignore @@ -0,0 +1,26 @@ +# Logs +logs +*.log + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Optional npm cache directory +.npm + +# Optional REPL history +.node_repl_history diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..6c4753d --- /dev/null +++ b/.travis.yml @@ -0,0 +1,19 @@ +language: node_js +node_js: + - '4' + - '5' + +before_install: + - npm i -g npm + # Workaround for a permissions issue with Travis virtual machine images + +addons: + firefox: 'latest' + +before_script: + - export DISPLAY=:99.0 + - sh -e /etc/init.d/xvfb start + +script: + - npm run lint + - npm test diff --git a/README.md b/README.md index 00c0d29..d57a8cd 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,25 @@ js-libp2p-ipfs > libp2p build (module) used in js-ipfs -## Usage +# Installation -## API +## npm -## Examples +```sh +> npm i libp2p-ipfs +``` + +## Use in Node.js + +```js +const lip2p = require('libp2p-ipfs') +``` + +# Usage + +# API + +# Examples - Start two libp2p Nodes (create and make them listen) - Set up a handler for a protocol (through multistream) diff --git a/circle.yml b/circle.yml new file mode 100644 index 0000000..6d74323 --- /dev/null +++ b/circle.yml @@ -0,0 +1,3 @@ +machine: + node: + version: stable diff --git a/examples/example.js b/examples/example.js index ade995a..65ce910 100644 --- a/examples/example.js +++ b/examples/example.js @@ -1,3 +1,6 @@ +'use strict' +/* eslint-disable no-console */ + const Peer = require('peer-info') const libp2p = require('../src') const multiaddr = require('multiaddr') diff --git a/package.json b/package.json index 24992ca..ace50af 100644 --- a/package.json +++ b/package.json @@ -2,10 +2,15 @@ "name": "libp2p-ipfs", "version": "0.2.0", "description": "The libp2p build (module) used by js-ipfs on Node.js", - "main": "src/index.js", + "main": "lib/index.js", + "jsnext:main": "src/index.js", "scripts": { - "test": "mocha tests/test-*.js", - "lint": "standard" + "test": "dignified-test node", + "build": "dignified-build node", + "lint": "dignified-lint", + "release": "dignified-release node", + "release-minor": "dignified-release node --minor", + "release-major": "dignified-release node --major" }, "repository": { "type": "git", @@ -22,9 +27,8 @@ "homepage": "https://github.com/ipfs/js-libp2p-ipfs#readme", "devDependencies": { "chai": "^3.5.0", - "mocha": "^2.4.5", - "pre-commit": "^1.1.2", - "standard": "^6.0.7" + "dignified.js": "^1.0.1", + "pre-commit": "^1.1.2" }, "dependencies": { "libp2p-spdy": "^0.2.3", diff --git a/src/index.js b/src/index.js index b04c633..51e2df2 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,5 @@ +'use strict' + const Swarm = require('libp2p-swarm') const Peer = require('peer-info') const TCP = require('libp2p-tcp') diff --git a/tests/test-libp2p-ipfs.js b/test/test-libp2p-ipfs.spec.js similarity index 98% rename from tests/test-libp2p-ipfs.js rename to test/test-libp2p-ipfs.spec.js index ff3aa24..ca37df8 100644 --- a/tests/test-libp2p-ipfs.js +++ b/test/test-libp2p-ipfs.spec.js @@ -1,3 +1,4 @@ +'use strict' /* eslint-env mocha */ const expect = require('chai').expect