Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

planktos

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

planktos - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

build/bundle.js

6

build/lib/client.js

@@ -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);

2

build/test/utils.js

@@ -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;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc