0.1.74 • Published 8 months ago

@filen/sync v0.1.74

Weekly downloads
-
License
AGPLv3
Repository
github
Last release
8 months ago

Contributors Forks Stargazers Issues License

Installation

  1. Install using NPM
npm install @filen/sync@latest
  1. Initialize sync pairs
import FilenSDK from "@filen/sdk"
import path from "path"
import os from "os"
import Sync from "@filen/sync"

// Initialize a SDK instance (optional)
const filen = new FilenSDK({
	metadataCache: true,
	connectToSocket: true,
	tmpPath: path.join(os.tmpdir(), "filen-sdk")
})

await filen.login({
	email: "your@email.com",
	password: "supersecret123",
	twoFactorCode: "123456"
})

const sync = new Sync({
	syncPairs: [
		{
			uuid: "UUIDV4", // Only used locally to identify the sync pair
			localPath: pathModule.join(__dirname, "sync"), // Local absolute path
			remotePath: "/sync", // Remote absolute path (UNIX style)
			remoteParentUUID: "UUIDV4", // UUIDv4 of the remote parent directory
			mode: "twoWay", // Sync mode
			paused: false, // Start paused
			excludeDotFiles: true, // Exclude dot files and paths
			localTrashDisabled: false, // Disable the local trash
			name: "Sync" // Only used locally to identify the sync pair
		}
	],
	sdk: filen, // You can either directly pass a configured FilenSDK instance or instantiate a new SDK instance when passing `sdkConfig` (optional)
	sdkConfig, // FilenSDK config object (omit when SDK instance is passed, needed when no SDK instance is passed)
	dbPath: pathModule.join(__dirname, "db"), // Used to store sync state and other data
	runOnce: false, // Run the sync once
	onMessage(message) {
		console.log(message.type)
	}
})

// Start the sync
await sync.initialize()

License

Distributed under the AGPL-3.0 License. See LICENSE for more information.

0.1.74

8 months ago

0.1.72

9 months ago

0.1.73

9 months ago

0.1.71

9 months ago

0.1.70

9 months ago

0.1.63

9 months ago

0.1.64

9 months ago

0.1.65

9 months ago

0.1.66

9 months ago

0.1.67

9 months ago

0.1.68

9 months ago

0.1.69

9 months ago

0.1.62

9 months ago

0.1.61

9 months ago

0.1.60

9 months ago

0.1.58

9 months ago

0.1.56

10 months ago

0.1.57

10 months ago

0.1.55

10 months ago

0.1.54

10 months ago

0.1.53

10 months ago

0.1.52

10 months ago

0.1.51

10 months ago

0.1.50

10 months ago

0.1.49

10 months ago

0.1.48

10 months ago

0.1.47

10 months ago

0.1.46

10 months ago

0.1.45

10 months ago

0.1.44

10 months ago

0.1.43

10 months ago

0.1.42

10 months ago

0.1.41

10 months ago

0.1.40

10 months ago

0.1.39

11 months ago

0.1.38

11 months ago

0.1.37

11 months ago

0.1.36

11 months ago

0.1.35

11 months ago

0.1.34

11 months ago

0.1.33

11 months ago

0.1.32

11 months ago

0.1.31

11 months ago

0.1.30

11 months ago

0.1.29

11 months ago

0.1.28

11 months ago

0.1.27

11 months ago

0.1.26

11 months ago

0.1.25

11 months ago

0.1.24

11 months ago

0.1.23

11 months ago

0.1.22

11 months ago

0.1.21

11 months ago

0.1.20

11 months ago

0.1.19

11 months ago

0.1.18

11 months ago

0.1.17

11 months ago

0.1.16

11 months ago

0.1.15

11 months ago

0.1.14

11 months ago

0.1.13

11 months ago

0.1.12

11 months ago

0.1.11

11 months ago

0.1.10

11 months ago

0.1.9

11 months ago

0.1.8

11 months ago

0.1.7

11 months ago

0.1.6

11 months ago

0.1.5

12 months ago

0.1.4

12 months ago

0.1.3

12 months ago

0.1.1

1 year ago