Comparing version 0.0.6 to 0.0.7
@@ -144,2 +144,8 @@ "use strict"; | ||
exports.Client = Client; | ||
/* Helper function which simplifies the bootstrapping process */ | ||
function bootstrap(socketioUrl, useWebRtc) { | ||
if (useWebRtc === void 0) { useWebRtc = true; } | ||
return new Client(socketioUrl, useWebRtc); | ||
} | ||
exports.bootstrap = bootstrap; | ||
function genRandomString() { | ||
@@ -146,0 +152,0 @@ return "" + Math.round(Math.random() * 99999999999); |
@@ -42,3 +42,3 @@ "use strict"; | ||
// support in nodejs is... tricky... | ||
var c = new client_1.Client(url, false); | ||
var c = client_1.bootstrap(url, false); | ||
testnet.peers.push(c); | ||
@@ -45,0 +45,0 @@ return c; |
@@ -149,2 +149,7 @@ import { ChannelManager, Channel, Message, startManager } from './channel'; | ||
/* Helper function which simplifies the bootstrapping process */ | ||
export function bootstrap(socketioUrl?: string, useWebRtc = true) { | ||
return new Client(socketioUrl, useWebRtc); | ||
} | ||
function genRandomString() { | ||
@@ -151,0 +156,0 @@ return "" + Math.round(Math.random() * 99999999999); |
{ | ||
"name": "planktos", | ||
"description": "A library for making p2p web apps", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"homepage": "http://www.planktos.xyz", | ||
"main": "./build/lib/client.js", | ||
"bin": "./bin/server.js", | ||
"license": "MIT", | ||
"engines": { | ||
"node": ">=5 <6" | ||
}, | ||
"keywords": [ | ||
@@ -22,7 +26,7 @@ "planktos", | ||
"scripts": { | ||
"start": "node build/server/index.js", | ||
"test": "rm -r build; tsc && mocha build/test --use-strict", | ||
"postinstall": "", | ||
"prepublish": "typings install && npm test", | ||
"serve": "tsc --watch & nodemon --delay 4 --watch build build/server/index.js", | ||
"start": "./bin/server.js", | ||
"test": "mocha build/test --use-strict", | ||
"build": "rm -r build; tsc && browserify -r ./build/lib/client.js:planktos -o ./build/bundle.js", | ||
"prepublish": "typings install && npm run build && npm test", | ||
"browserify": "browserify", | ||
"typings": "typings", | ||
@@ -32,14 +36,13 @@ "tsc": "tsc" | ||
"dependencies": { | ||
"express": "^4.13.3", | ||
"simple-peer": "^6.0.4", | ||
"socket.io": "^1.3.5", | ||
"socket.io-client": "^1.3.5", | ||
"express": "^4.13.3" | ||
"socket.io-client": "^1.3.5" | ||
}, | ||
"devDependencies": { | ||
"browserify": "^13.0.1", | ||
"mocha": "^2.3.4", | ||
"nodemon": "^1.9.2", | ||
"typescript": "^1.8.10", | ||
"typings": "^1.0.4", | ||
"vinyl-source-stream": "^1.1.0" | ||
"typings": "^1.0.4" | ||
} | ||
} |
@@ -5,28 +5,31 @@ # Planktos | ||
[![Build Status](https://travis-ci.org/planktos-xyz/planktos.svg?branch=master)](https://travis-ci.org/planktos-xyz/planktos) | ||
[![npm version](https://badge.fury.io/js/planktos.svg)](https://badge.fury.io/js/planktos) | ||
Planktos is a library for building p2p web applications. A simple push/pull interface is provided for storing and retreiving data in a distributed way; so all the data is stored on the peers visiting the website and not on any servers. The code is in an early alpha state so there are bound to be bugs and inefficiencies. If you want to help out, join us on [gitter](https://gitter.im/planktos-xyz/planktos) or try out our live demo at [chatter.planktos.xyz](http://chatter.planktos.xyz). | ||
Planktos is a library for building p2p web applications. A simple push/pull interface is provided for storing and retreiving data in a distributed way; so all the data is stored on the peers visiting the website and not on any servers. The code is in an early alpha state so there are bound to be bugs and inefficiencies. If you want to help out, join us on [gitter](https://gitter.im/planktos-xyz/planktos). | ||
We built [Posted](https://github.com/planktos-xyz/posted) a post-based website with Planktos, and you can find our live demo at [posted.planktos.xyz](http://posted.planktos.xyz) | ||
## Setup - start hacking | ||
To get setup, [NodeJs](https://nodejs.org/) and it's package manager [npm](http://blog.npmjs.org/post/85484771375/how-to-install-npm) will need to be installed. Once installed, clone the repo and run `npm install` from within the project root to install all the dependcies. Once the project moves out of the alpha state, npm and bower modules will be made available for the code. | ||
To get setup, [NodeJs](https://nodejs.org/) and it's package manager [npm](http://blog.npmjs.org/post/85484771375/how-to-install-npm) will need to be installed. Once installed, clone the repo and run `npm install` from within the repo root to install all the dependcies. | ||
## Running and Building | ||
There are three main components to this repo: | ||
There are two main components to this repo: | ||
1. Server - keeps track of the peers in the network and forwards webrtc signaling information | ||
2. Library - Browser code that handles all the storing, retrieving, and discovering data in the network. All of this code is written in typescript. | ||
3. App - A demo application that utilizes the library to run a post-based website were users can create and view posts. | ||
Running `npm start` from within the project root will compile everything and start an http server on port 8000 serving the demo app. When file changes are detected, the code is automatically recompilled. Alternatively, you can run `npm run gulp -- build-lib` to just build the lib, but not start the server. | ||
To build the lib and transpile the typescript code run: | ||
Opening up a web browser and pointing it to `http://localhost:8000/` will load the demo app. | ||
```npm run build``` | ||
## Project layout | ||
This will store the library in the `build` directory. | ||
To start the server that is needed for webrtc signaling run: | ||
``` | ||
├── test # Stores the tests | ||
├── app # Demo web app that utilizes planktos | ||
├── lib # Meat of the project. Houses the p2p code written in typescript | ||
├── build # Compiled output for `app` and `lib` | ||
└── README.md # This file | ||
``` | ||
```npm start``` | ||
The signaling server is now running on port 8000 | ||
To run the tests, run (the server does not have to be running): | ||
```npm test``` |
@@ -1,2 +0,2 @@ | ||
import { Client } from '../lib/client'; | ||
import { Client, bootstrap } from '../lib/client'; | ||
import { Server } from '../server'; | ||
@@ -52,3 +52,3 @@ | ||
// support in nodejs is... tricky... | ||
const c = new Client(url, false); | ||
const c = bootstrap(url, false); | ||
testnet.peers.push(c); | ||
@@ -55,0 +55,0 @@ return c; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
405779
4
12498
35
0
8
3