{"id":27184313,"url":"https://github.com/lemontron/easy-backblaze","last_synced_at":"2025-04-09T16:54:26.040Z","repository":{"id":57218298,"uuid":"92557334","full_name":"lemontron/easy-backblaze","owner":"lemontron","description":"The absolute simplest way possible to make Backblaze B2 API calls.","archived":false,"fork":false,"pushed_at":"2017-08-27T22:18:27.000Z","size":21,"stargazers_count":12,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T19:05:19.036Z","etag":null,"topics":["backblaze","backblaze-b2"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lemontron.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-27T00:06:04.000Z","updated_at":"2023-08-20T23:05:52.000Z","dependencies_parsed_at":"2022-08-28T21:01:41.088Z","dependency_job_id":null,"html_url":"https://github.com/lemontron/easy-backblaze","commit_stats":null,"previous_names":["lemontron/easy-backblaze","jamesloper/easy-backblaze"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemontron%2Feasy-backblaze","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemontron%2Feasy-backblaze/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemontron%2Feasy-backblaze/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemontron%2Feasy-backblaze/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lemontron","download_url":"https://codeload.github.com/lemontron/easy-backblaze/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248074010,"owners_count":21043476,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backblaze","backblaze-b2"],"created_at":"2025-04-09T16:54:25.530Z","updated_at":"2025-04-09T16:54:26.023Z","avatar_url":"https://github.com/lemontron.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"`npm install --save easy-backblaze`\n\nEasy Backblaze is a powerful, yet simple and lightweight re-imagination of the Backblaze API. Upload a file in one call, just like in S3! Because of the depth and complexity of simply uploading, for now, this package will focus only on uploading a file. It will retry after encountering 429 (Too Many Requests), 408 (Request Timeout), 500 (Internal Error) and 503 (Service Unavailable) errors.\n\n``` javascript\nvar B2 = require('easy-backblaze');\nvar b2 = new B2('account_id', 'application_key');\n\nb2.uploadFile('/var/tmp/test.mp4', {\n    name: 'swiggity-swooty.mp4', // Optional, renames file\n    bucket: 'swooty', // Optional, defaults to first bucket\n}, function(err, res) {\n    console.log('Done!', err, res);\n});\n\n// res = https://f001.backblazeb2.com/file/swooty/swiggity-swooty.mp4\n```\n\n## Get Progress Updates\n\n``` javascript\nvar client = b2.uploadFile('/var/tmp/test.mp4', function(err, res) {\n    console.log('Done!', err, res);\n});\n\nclient.on('progress', function(progress) {\n    // Every time 512 KB finish uploading\n    console.log('Progress:', progress);\n});\n```\n\n\n## AES-256 Encryption\n\nTo upload a file and encrypt it, just add a **password**:\n\n``` javascript\nb2.uploadFile('/var/tmp/test.mp4', {\n    password: 'ggf96fjo',\n    name: 'secretFileName.mp4',\n}, function(err, res) {\n    console.log('Done!', err, res);\n});\n```\n\nTo decrypt, download and pipe the stream through any old compatible decipher:\n\n``` javascript\nvar decipher = crypto.createDecipher('aes-256-ctr', 'ggf96fjo');\nvar input = fs.createReadStream('test.mp4');\nvar output = fs.createWriteStream('output.mp4');\ninput.pipe(decipher).pipe(output);\n```\n\n## Additional Options\n\nAn additional **options** argument can be used to specify a default bucket for uploads. \n\n``` javascript\nvar b2 = new B2('account_id', 'application_key', {bucket: 'swooty'});\nb2.uploadFile('/var/tmp/test.mp4', function(err, res) {\n    console.log('Done!', err, res);\n});\n```\n\n\u003e If you appreciate the work that went into this, donate to 15BHA6gPYszTfsbDHUag4nu6WZiQPkDoUL","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemontron%2Feasy-backblaze","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flemontron%2Feasy-backblaze","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemontron%2Feasy-backblaze/lists"}