backblaze-b2-sdk

    1.2.0 • Public • Published

    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')
      });
    })();

    Install

    npm i backblaze-b2-sdk

    DownloadsWeekly Downloads

    16

    Version

    1.2.0

    License

    MIT

    Unpacked Size

    4.7 kB

    Total Files

    4

    Last publish

    Collaborators

    • deepalig25
    • dubkrapht
    • evgdema
    • denis