Socket
Socket
Sign inDemoInstall

backblaze-b2

Package Overview
Dependencies
3
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    backblaze-b2

Node.js Library for the Backblaze B2 Storage Service


Version published
Weekly downloads
3.5K
decreased by-6.49%
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

v0.9.4 (December 3, 2015) - The all the things API release

Features

  • Download file by fileId
  • Delete file version

Readme

Source

Backblaze B2 Node.js Library

npm version Build Status

This library uses promises, so all actions on a B2 instance return a promise in the following pattern

b2.instanceFunction(arg1, arg2).then(
    successFn(response) { ... },
    errorFn(err) { ... } 
);

Status of project

All B2 API's have been implemented. See below for usage.

Usage

var B2 = require('backblaze-b2');

// create b2 object instance
var b2 = new B2({
    accountId: 'accountId',
    applicationKey: 'applicationKey'
});

// authorize with provided credentials
b2.authorize();  // returns promise

// create bucket
b2.createBucket(bucketName, bucketType);  // returns promise

// delete bucket
b2.deleteBucket(bucketId);  // returns promise

// list buckets
b2.listBuckets();  // returns promise

// update bucket2
b2.updateBucket(bucketId, bucketType);  // returns promise

// get upload url
b2.getUploadUrl(bucketId);  // returns promise

// upload file
b2.uploadFile({
    uploadUrl: 'uploadUrl',
    uploadAuthToken: 'uploadAuthToken',
    filename: 'filename',
    data: 'data'
});  // returns promise
    
// list file names
b2.listFileNames({
    bucketId: 'bucketId',
    startFileName: 'startFileName',
    maxFileCount: 100
});  // returns promise
        
// list file versions
b2.listFileVersions({
    bucketId: 'bucketId',
    startFileName: 'startFileName',
    maxFileCount: 100
});  // returns promise
        
// hide file
b2.hideFile({
    bucketId: 'bucketId',
    fileName: 'fileName',
});  // returns promise
            
// get file info
b2.getFileInfo(fileId);  // returns promise

// download file by name
b2.downloadFileByName({
    bucketName: 'bucketName',
    fileName: 'fileName'
});  // returns promise
            
// download file by fileId
b2.downloadFileById(fileId);  // returns promise

// delete file version
b2.deleteFileVersion({
    fileId: 'fileId',
    fileName: 'fileName'
});  // returns promise

Keywords

FAQs

Last updated on 03 Dec 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc