Registry / storage / firebase-storage

firebase-storage

JSON →
library1.1.4jsnpmunverified

A lightweight Node.js library for interacting with Google Cloud Storage using Firebase service account credentials (private key). Version 1.1.4 supports file upload, download, list, info, delete, bucket info, and bucket update operations. Designed for Edge runtime compatibility, it uses the official google-auth-library for authentication and simplifies bucket/file management. Unlike the main Firebase Admin SDK, this package focuses exclusively on storage with a minimal API and supports parallel uploads (configurable). Released under MIT license, actively maintained.

storage
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Default export is not available; only named export 'getStorage' exists.

import { getStorage } from 'firebase-storage'

Storage is a TypeScript type (interface), not a runtime value. Use type import.

import type { Storage } from 'firebase-storage'

Library is ESM-first; require() works but must destructure named export.

const { getStorage } = require('firebase-storage')

Demonstrates basic upload, info, download, and delete operations using a service account with private key.

const { getStorage } = require('firebase-storage'); const privateKey = process.env.FIREBASE_PRIVATE_KEY?.replace(/\\n/g, '\n') ?? ''; const clientEmail = process.env.FIREBASE_CLIENT_EMAIL ?? ''; const bucket = process.env.FIREBASE_STORAGE_BUCKET ?? ''; async function main() { const storage = getStorage({ privateKey, clientEmail, bucket }); const file = new Blob(['Hello world'], { type: 'text/plain' }); await storage.upload({ name: 'hello.txt', file, published: true }); const info = await storage.info({ name: 'hello.txt' }); console.log('Uploaded:', info); const data = await storage.download({ name: 'hello.txt' }); console.log('Content:', new TextDecoder().decode(data)); await storage.del({ name: 'hello.txt' }); } main().catch(console.error);
Debug
Known footguns
gotchaPrivate key must have newlines replaced with \n when passed as environment variable.
gotchaSetting `parallels: 5` limits concurrent uploads when uploading multiple files; default is 1000 which may cause resource issues.
deprecatedThe 'published' option in upload is deprecated; use 'public' instead in future versions.
breakingIn v1.0.0, the 'getStorage' function required a different parameter shape (bucket was not required).
gotchaThe library is ESM-only for Node.js; using require() with TypeScript may require esModuleInterop.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
20 hits · last 30 days
amazonbot
4
bytedance
4
gptbot
3
ahrefsbot
1
Resources