# @tamedjs/tm-sync

> The TamedJs tool for syncing TM Drives.

Latest version **0.15.0** (published 2023-01-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @tamedjs/tm-sync
pnpm add @tamedjs/tm-sync
yarn add @tamedjs/tm-sync
bun add @tamedjs/tm-sync
```

Provides the command `tmsync`.

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.15.0 |
| Published | 2023-01-04 |
| First published | 2022-07-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 22 |
| Unpacked size | 372.5 KB |
| Known vulnerabilities | 0 (+24 in 1 direct dependencies) |
| Install scripts | no |
| Author | The TRG, LLC |
| Maintainers | ronbravodev |

## Links

- npm: https://www.npmjs.com/package/@tamedjs/tm-sync
- npm.io page: https://npm.io/package/@tamedjs/tm-sync

## Dependencies (22)

- [cors](https://npm.io/package/cors.md) ^2.8.5
- [pako](https://npm.io/package/pako.md) ^2.0.4
- [async](https://npm.io/package/async.md) ^3.2.4
- [axios](https://npm.io/package/axios.md) ^0.27.2
- [json5](https://npm.io/package/json5.md) ^2.2.1
- [yargs](https://npm.io/package/yargs.md) ^17.5.1
- [globby](https://npm.io/package/globby.md) ^13.1.2
- [nanoid](https://npm.io/package/nanoid.md) ^3.3.4
- [globrex](https://npm.io/package/globrex.md) ^0.1.2
- [restana](https://npm.io/package/restana.md) ^4.9.6
- [fs-extra](https://npm.io/package/fs-extra.md) ^10.1.0
- [crypto-js](https://npm.io/package/crypto-js.md) ^4.1.1
- [kill-port](https://npm.io/package/kill-port.md) ^2.0.1
- [socket.io](https://npm.io/package/socket.io.md) ^4.5.1
- [websocket](https://npm.io/package/websocket.md) ^1.0.34
- [node-forge](https://npm.io/package/node-forge.md) ^1.3.1
- [selfsigned](https://npm.io/package/selfsigned.md) ^2.0.1
- [split-file](https://npm.io/package/split-file.md) ^2.3.0
- [body-parser](https://npm.io/package/body-parser.md) ^1.20.0
- [forever-monitor](https://npm.io/package/forever-monitor.md) ^3.0.3
- [socket.io-client](https://npm.io/package/socket.io-client.md) ^4.5.1
- [is-port-reachable](https://npm.io/package/is-port-reachable.md) ^4.0.0

## Recent versions

- 0.15.0 (latest) — 2023-01-04
- 0.14.0 — 2022-10-22
- 0.13.0 — 2022-08-09
- 0.12.0 — 2022-08-06
- 0.11.0 — 2022-07-28
- 0.10.0 — 2022-07-28
- 0.9.0 — 2022-07-28
- 0.8.0 — 2022-07-28
- 0.7.0 — 2022-07-27
- 0.6.0 — 2022-07-27
- 0.5.0 — 2022-07-26
- 0.4.0 — 2022-07-25
- 0.3.0 — 2022-07-25
- 0.2.0 — 2022-07-25
- 0.1.0 — 2022-07-25

## README

# TM Sync

The TamedJs tool for syncing TM Drives.

## Issues

* The [PEM Library will not work on OpenSSL](https://github.com/coder/code-server/issues/5162) beyond `1.1.1g`.
* This means when placing on an OS (like Ubuntu past 20.04) you will get newever versions of OpenSSL.
* Droplets on DigitalOcean can cause issues using `npm install` where the binary detects root acess. Use `yarn global add @tamedjs/tm-sync` instead.

## Testing System

Below is an example of how to test tm-sync locally running the `tmsync` command. It requires starting two tm-sync hubs that can communicate with one another.

```
# Start hub 1, note the testing arguments
tmsync --testing true --testfiles true --user @test1 --port 9000

# Start hub 2 that will connect to hub 1
tmsync --testing true --user @test2 --port 9001 --hubs https://localhost:9000

---

# RESTFUL API Calls

---
# Check the folders for the hub at port 9000
request:
POST https://localhost:9000/_tm/api/tm-sync/scan
{
	"depth": 1,
	"target": "@test1/public/sample"
}
reply:
{
  "code": 200,
  "message": "ok",
  "result": [
    "@test1/public/sample/image.png",
    "@test1/public/sample/test.txt"
  ]
}

---
Send details on file to be synced with other hubs
request:
POST https://localhost:9000/_tm/api/tm-sync/sync
{
	"target": "@test1/public/sample/image.png"
}
reply:
{
    "code": 201,
    "message": "created"
}

---
Check if a path is valid
request:
POST https://localhost:9000/_tm/api/tm-sync/path
  // for dir (NOTE: probably just make this one command...)
  {
    "target": "@test1/public/sample/image.png",
    "isDir": true
  }

  // for files
  {
    "target": "@test1/public/sample/image.png"
  }
reply:
{
  "code": 200,
  "message": "ok"
}

```

## TODO

* Allow the path checking work the same for a file or directory (remove isDir)
* Version the api routes
* Version the payload responses

## Resource

* [PEM Library Issues](https://github.com/coder/code-server/issues/5162) - Noet 1
* [Cl1p](https://cl1p.net) - An online clipboard that can be shared by QR Code or custom URL
* [RustDesk OS](https://www.youtube.com/watch?v=9nzHm3xGz2I) - An opensource self hosted remote desktop viewer.

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