@meeco/file-storage-node
TypeScript icon, indicating that this package has built-in type declarations

5.0.3 • Public • Published

@meeco/file-storage-node

IMPORTANT: there are many improvements and optimisation planned for this package, it is not recommended to use it except for PoC at this stage.

This file storage code has been seperated out of the main @meeco/sdk to keep it smaller.

Installation

npm install -S @meeco/file-storage-node

Basic Usage

File Upload

const uploadedFile = await largeFileUploadNode(fileConfig.file, environment, {
  data_encryption_key,
  vault_access_token,
});
console.log(uploadedFile);

File Download

const downloadedFile = await fileDownloadNode(
  attachmentId,
  environment,
  {
    data_encryption_key: authConfig.data_encryption_key.key,
    vault_access_token: authConfig.vault_access_token,
  },
  attachmentSlotValueDek,
  this.updateStatus
);
await fs.writeFileSync(outputPath + downloadedFile.fileName, downloadedFile.buffer);

More detailed usage

Please see the detailed usage in the cli project in this repository (specifically ../cli/src/commands/items/attach-file.ts and../cli/src/commands/items/get-attachment.ts)

Readme

Keywords

none

Package Sidebar

Install

npm i @meeco/file-storage-node

Weekly Downloads

0

Version

5.0.3

License

ISC

Unpacked Size

134 kB

Total Files

21

Last publish

Collaborators

  • janvereecken-meeco
  • dmunneke-meeco
  • linasisganaitis-meeco
  • meeco-ci