# @teleport-js/teleport

> Teleport.js Hybrid P2P File transfer

Latest version **0.0.10** (published 2021-01-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install @teleport-js/teleport
pnpm add @teleport-js/teleport
yarn add @teleport-js/teleport
bun add @teleport-js/teleport
```

Provides the command `teleport`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.10 |
| Published | 2021-01-05 |
| First published | 2020-12-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 <15.0.0 |
| Dependencies | 39 |
| Unpacked size | 1.9 MB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | yes |
| Maintainers | kandavel, stalemate, mohanpierce99 |

## Links

- npm: https://www.npmjs.com/package/@teleport-js/teleport
- Repository: https://github.com/teleport-js/teleport
- Homepage: https://github.com/teleport-js/teleport#readme
- Issues: https://github.com/teleport-js/teleport/issues
- npm.io page: https://npm.io/package/@teleport-js/teleport

## Dependencies (39)

- [wrtc](https://npm.io/package/wrtc.md) ^0.4.6
- [clear](https://npm.io/package/clear.md) ^0.1.0
- [debug](https://npm.io/package/debug.md) ^4.2.0
- [fuzzy](https://npm.io/package/fuzzy.md) ^0.1.3
- [buffer](https://npm.io/package/buffer.md) ^5.6.0
- [cfonts](https://npm.io/package/cfonts.md) ^2.8.1
- [colors](https://npm.io/package/colors.md) ^1.4.0
- [express](https://npm.io/package/express.md) ^4.17.1
- [fs-extra](https://npm.io/package/fs-extra.md) ^9.0.1
- [fsevents](https://npm.io/package/fsevents.md) ^2.2.1
- [inquirer](https://npm.io/package/inquirer.md) ^7.1.0
- [ascii-art](https://npm.io/package/ascii-art.md) ^2.5.0
- [babel-cli](https://npm.io/package/babel-cli.md) ^6.26.0
- [commander](https://npm.io/package/commander.md) ^5.0.0
- [is-stream](https://npm.io/package/is-stream.md) ^2.0.0
- [socket.io](https://npm.io/package/socket.io.md) 2.3.0
- [clipboardy](https://npm.io/package/clipboardy.md) ^2.3.0
- [file-saver](https://npm.io/package/file-saver.md) ^2.0.2
- [mime-types](https://npm.io/package/mime-types.md) ^2.1.27
- [webtorrent](https://npm.io/package/webtorrent.md) 0.112.0
- [webworkify](https://npm.io/package/webworkify.md) ^1.5.0
- [cli-spinner](https://npm.io/package/cli-spinner.md) ^0.2.10
- [simple-peer](https://npm.io/package/simple-peer.md) ^9.9.3
- [streamsaver](https://npm.io/package/streamsaver.md) ^2.0.4
- [center-align](https://npm.io/package/center-align.md) ^1.0.1
- [cli-progress](https://npm.io/package/cli-progress.md) ^3.6.0
- [end-of-stream](https://npm.io/package/end-of-stream.md) 1.4.1
- [patch-package](https://npm.io/package/patch-package.md) ^6.2.2
- [readable-stream](https://npm.io/package/readable-stream.md) ^3.6.0
- [socket.io-client](https://npm.io/package/socket.io-client.md) 2.3.0
- [filereader-stream](https://npm.io/package/filereader-stream.md) ^2.0.0
- [on-change-network](https://npm.io/package/on-change-network.md) 0.0.2
- [string-similarity](https://npm.io/package/string-similarity.md) ^4.0.3
- [webtorrent-hybrid](https://npm.io/package/webtorrent-hybrid.md) 4.0.2
- [memory-chunk-store](https://npm.io/package/memory-chunk-store.md) ^1.3.0
- [parse-numeric-range](https://npm.io/package/parse-numeric-range.md) ^1.2.0
- [immediate-chunk-store](https://npm.io/package/immediate-chunk-store.md) ^2.1.0
- [inquirer-autocomplete-prompt](https://npm.io/package/inquirer-autocomplete-prompt.md) ^1.3.0
- [@babel/plugin-transform-runtime](https://npm.io/package/@babel/plugin-transform-runtime.md) ^7.12.10

## Recent versions

- 0.0.10 (latest) — 2021-01-05
- 0.0.9 — 2021-01-05
- 0.0.8 — 2020-12-20
- 0.0.7 — 2020-12-19
- 0.0.6 — 2020-12-19
- 0.0.5 — 2020-12-18
- 0.0.4 — 2020-12-18
- 0.0.3 — 2020-12-18
- 0.0.2 — 2020-12-18
- 0.0.1 — 2020-12-14

## README

<h1 align="center">
  <br>
  <img src="https://res.cloudinary.com/dqmbs2chk/image/upload/v1603729357/portalLogoBlack_x1xg7p.png" alt="Teleport" width="100">
  <br>
  <br>
  <span>Teleport.js</span>
  <br>
</h1>
<h4 align="center">Hybrid P2P File transfer Javascript module for both node and the web</h4>

## Features

- Available as a CLI tool and a website 🚀 - Which can talk between themselves or each other.
- An opensource alternative to AirDrop - Discovers localNetwork devices and get Files with a single click
- No signUp needed fully P2P.
- Unique approach of using a mix of WebRTC and Webtorrent to scale onDemand and reusing existing connections and storage
- Supports multiple users at the same time for a file.
- Evades the wait time for torrent-creation induced by webTorrent by mimicing the chunkStore using normal webRTC and seding pieces prematurely. Once the torrent has been created , every peer connection is reused and webTorrent downloads only the pieces left - Huge perfomance boost 🚀.
- Uses the best approach based on the scale, torrentMode gets activated only if the roomSize gets larger ( more than 2 receivers)

## Installing and CLI Usage

NPM install globally

```npm
$ npm i -g @teleport-js/teleport
```

To send a file

```bash
$ teleport send a.txt
```

To receive a file/text data using portal_code

```bash
$ teleport receive tyu-dsf-hji
```

To send clipboard data

```bash
$ teleport send -c
```

Find nearby / recently used portals

```bash
$ teleport receive
```

To send Text data

```bash
$ teleport send -t "Hello world"
```

To receive a file/text data using a recently connected nickname

```bash
$ teleport receive mike
```

## API Usage

Create a new instance

```javascript
const teleport = new Teleport(
  {
    server: "teleport server url", //Default heroku url
    onConnect: init,
  } // Called once instantiated
);
```

Create a room

```javascript
teleport.createRoom(
  "Myroom", //nickname
  (words) => {
    console.log(words);
  }
); // callback called with roomJoining code apple-orange-cable
```

Join a room

```javascript
teleport.joinRoom({nickname:'User1'  // Display name on Joining the room
roomName:'apple-orange-cable'},()=>{console.log('Room Joined')}) // callback on successfully joining the room
```

Search for rooms in the localNetwork and join them without RoomCode (Privacy configurable)

```javascript
teleport.search((roomCodes) => {
  console.log(roomCodes); // ['apple-orange-cable']
});
```

---
_Source: https://npm.io/package/@teleport-js/teleport · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
