Skip to content

basalt / drives/src / importItem

Function: importItem() ​

> importItem(drives, connectionId, item, sink, options?): Promise<DriveImportOutcome>

Defined in: drives/src/import.ts:175

Imports one item: dedup check, then (for copy) stream it through the sink.

Ordering matters and is the reason this is not inline in the sync loop: the ledger is consulted before the download, so an unchanged file costs one cheap local read instead of its own size in egress. For a nightly sync over a folder that rarely changes, that is the difference between a few kilobytes and the whole corpus, every night.

Parameters ​

drives ​

Drives

connectionId ​

string

item ​

DriveItem

sink ​

DriveSink

options? ​

ImportOptions = {}

Returns ​

Promise<DriveImportOutcome>

Released under the MIT License.