Преглед на файлове

Published module on NPM

- Had to rename the repo to `peerjs-on-nodejs`
- Updated the docs and some code to reflect the change in name
Satnam Singh Brar преди 5 години
родител
ревизия
444f32ff58
променени са 6 файла, в които са добавени 29 реда и са изтрити 13 реда
  1. 8 0
      .npmignore
  2. 11 4
      README.md
  3. 2 2
      build.sh
  4. 2 2
      examples/README.md
  5. 1 1
      index.js
  6. 5 4
      package.json

+ 8 - 0
.npmignore

@@ -0,0 +1,8 @@
+build.sh
+examples/
+node_modules/
+package-lock.json
+peerjs/
+package.json
+patch/
+README.md

+ 11 - 4
README.md

@@ -1,22 +1,29 @@
 # Node PeerJS
 
+[![Version](https://img.shields.io/npm/v/node-peerjs.svg)](https://www.npmjs.org/package/peerjs-on-nodejs)
+
 A port of the [PeerJS library](https://github.com/peers/peerjs) which currently only works on browsers. It uses the `wrtc` node module to provide webrtc functionality and fixes various compatibility issues with NodeJS.
 
 ## Install
 
 ```
-npm i --save node-peerjs
+npm i --save peerjs-on-node
 ```
 
 ## Usage
 
-Just refer to the PeerJS documentation for a more detailed description of how the module works. You can also take a look at the `examples/` directory in this repo to see a small example using `node-peerjs`
+Just refer to the PeerJS documentation for a more detailed description of how the module works. You can also take a look at the `examples/` directory in this repo to see a small example using `peerjs-on-node`
+- Import the module like this
+
+    ```
+    const Peer = require('peerjs-on-node').Peer;
+    ```
 
 ## Build history
 
 #### v1.0.0
 
-- Based on commit [0645dc3ddd51cbc1649ed13af56d9b66958fd62b](https://github.com/peers/peerjs/commit/0645dc3ddd51cbc1649ed13af56d9b66958fd62b) of PeerJS
+- Based on commit [0645dc3](https://github.com/peers/peerjs/commit/0645dc3ddd51cbc1649ed13af56d9b66958fd62b) of PeerJS
 - First release version that tries to make most of the peerJS functionality work on NodeJS
-- See file `patch.diff` for all the modification made to the base PeerJS code and get it running on NodeJS
+- See file `patch/patch.diff` for all the modification made to the base PeerJS code and get it running on NodeJS
 - PeerJS code not included in this repo

+ 2 - 2
build.sh

@@ -16,7 +16,7 @@ git diff -- . ':(exclude)dist/*' > ../patch/base_code_changes.diff
 cd ../
 
 # Append some of our modifications onto the built peerjs code
-cat patch/header_patch.js dist/peerjs.min.js patch/footer_patch.js > dist/node-peerjs.js
+cat patch/header_patch.js dist/peerjs.min.js patch/footer_patch.js > dist/peerjs-on-node.js
 rm dist/peerjs.min.js
 
-echo "Done. dist/node-peerjs.js"
+echo "Done. dist/peerjs-on-node.js"

+ 2 - 2
examples/README.md

@@ -1,6 +1,6 @@
-# node-peerjs examples
+# Examples
 
-- The example scripts in this directory implements a simple echo server over a P2P webRTC connection using `node-peerjs`
+- The example scripts in this directory implements a simple echo server over a P2P webRTC connection using `peerjs-on-node`
 - Run the server
     
     ```

+ 1 - 1
index.js

@@ -1 +1 @@
-module.exports = require('./dist/node-peerjs.js').peerjs;
+module.exports = require('./dist/peerjs-on-node.js').peerjs;

+ 5 - 4
package.json

@@ -1,14 +1,15 @@
 {
-  "name": "node-peerjs",
-  "version": "1.0.0",
+  "name": "peerjs-on-node",
+  "version": "1.0.1",
   "description": "nodejs wrtc + peerjs",
   "keywords": [
     "webrtc",
     "wrtc",
     "nodejs",
-    "peerjs"
+    "peerjs",
+    "p2p"
   ],
-  "repository": "https://github.com/Mantaseus/node-peerjs",
+  "repository": "https://github.com/Mantaseus/peerjs-on-node",
   "author": "Mantaseus",
   "license": "MIT",
   "scripts": {},