1.2.0 • Published 4 years ago

backblaze-b2-sdk v1.2.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

Backblaze B2 SDK

Simple backblaze b2 sdk for nodejs.

This is a work in progress, only the upload file function is supported in the sdk.

Installation

$ npm install --save backblaze-b2-sdk

Usage

(async () => {
  const b2 = BackblazeB2({accountId: ACCOUNT_ID, masterApplicationKey: MASTER_APPLICATION_KEY});

  // Calling this method is optional, every sdk method will call this method if no previous authorization was made
  // The authorization token will be cached in a private variable for every other method to use
  await b2.authorizeAccount();

  const {authorizationToken, uploadUrl} = await b2.getUploadUrl({bucketId: '123'});

  await b2.uploadFile({
    authorizationToken,
    uploadUrl,
    fileName: 'test.txt',
    fileContent: Buffer.from('test content')
  });
})();
1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

5 years ago

1.0.0

6 years ago