From db0c6a24cea516259170befa1d36669efbae06bc Mon Sep 17 00:00:00 2001 From: "Lucian I. Last" Date: Tue, 13 Nov 2018 22:27:56 +0100 Subject: [PATCH] npm #45 (#48) * Edits on package.json #45 Add prepublishOnly https://docs.npmjs.com/misc/scripts Add bin https://docs.npmjs.com/files/package.json#bin * `chmod +x src/index.js` This is required because file is run from package.json:7 bin * Add npm install documentation #45 * Add npm badge * Styling change by npm in package.json * Add warning on npm global install https://github.com/jeremija/peer-calls/pull/48#issuecomment-437192240 --- README.md | 16 ++++++++++++++-- package.json | 4 ++++ src/index.js | 0 3 files changed, 18 insertions(+), 2 deletions(-) mode change 100644 => 100755 src/index.js diff --git a/README.md b/README.md index a4e0524..4b31105 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Peer Calls -[![Build Status](https://travis-ci.org/jeremija/peer-calls.svg?branch=master)](https://travis-ci.org/jeremija/peer-calls) +[![Build Status](https://travis-ci.org/jeremija/peer-calls.svg?branch=master)](https://travis-ci.org/jeremija/peer-calls) [![npm](https://img.shields.io/npm/v/peer-calls.svg)](https://www.npmjs.com/package/peer-calls) WebRTC peer to peer calls for everyone. See it live in action at [peercalls.com](https://peercalls.com). @@ -12,7 +12,19 @@ Work in progress. # Installation & Running -From git source: +## From npm + +create directory `./peer-calls` and copy [config/default.json](https://raw.githubusercontent.com/jeremija/peer-calls/master/config/default.json) into it. + +```bash +npm install --global peer-calls + +env NODE_CONFIG_DIR=./peer-calls peercalls +``` + +> :warning: Using `--global` is not advised in server environments. [*](https://github.com/jeremija/peer-calls/pull/48) + +## From git source ```bash git clone https://github.com/jeremija/peer-calls.git diff --git a/package.json b/package.json index fd00007..7c904e8 100644 --- a/package.json +++ b/package.json @@ -4,11 +4,15 @@ "description": "Group peer to peer video calls for anybody.", "repository": "https://github.com/jeremija/peer-calls", "main": "src/index.js", + "bin": { + "peercalls": "./src/index.js" + }, "scripts": { "start": "node src/index.js", "start:server": "nodemon src/index.js --ignore build/ --ignore src/client", "start:watch": "chastifol [ npm run js:watch ] [ npm run css:watch ] [ npm run start:server ]", "watch": "", + "prepublishOnly": "npm run build", "build": "npm run css && npm run js", "test": "jest", "test:coverage": "jest --coverage", diff --git a/src/index.js b/src/index.js old mode 100644 new mode 100755