1.0.6 • Published 2 months ago

@filen/filen-sdk v1.0.6

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

Contributors Forks Stargazers Issues License

Attention

The SDK is still a work in progress. DO NOT USE IT IN PRODUCTION YET. Class names, function names, types, definitions, constants etc. are subject to change until we release a fully tested and stable version.

Installation

  1. Install using NPM
npm install @filen/filen-sdk@latest
  1. Initialize the SDK.
import FilenSDK from "@filen/filen-sdk"

type FilenSDKConfig = {
	email?: string
	password?: string
	twoFactorCode?: string
	masterKeys?: string[]
	apiKey?: string
	publicKey?: string
	privateKey?: string
	authVersion?: AuthVersion
	baseFolderUUID?: string
	userId?: number
	metadataCache?: boolean // Cache decrypted metadata in memory. Recommended.
	tmpPath?: string // Temporary local path used to store metadata and chunks. Only available in Node.JS.
}

// You can either directly supply all needed config parameters to the constructor or call the .login() function to fetch them using your login information.
const filen = new FilenSDK({
	metadataCache: true,
	tmpPath: path.join(os.tmpdir(), "filen-sdk")
})

await filen.login({
	email: "your@email.com",
	password: "supersecret123",
	twoFactorCode: "123456"
})
  1. Interact with the cloud
// Create a directory
await filen.fs().mkdir({
	path: "/Pictures"
})

// Upload a file
await filen.fs().upload({
	path: "/Pictures",
	source: "/Local/path/to/a/file.jpg"
})

// Read contents of the directory
await filen.fs().readdir({
	path: "/Pictures"
})

// Stat a file
await filen.fs().stat({
	path: "/Pictures/file.jpg"
})

License

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

1.0.6

2 months ago

1.0.5

2 months ago

1.0.4

2 months ago

1.0.2

3 months ago

1.0.1

3 months ago

1.0.3

3 months ago

1.0.0

3 months ago