Google Cloud Storage

Node.js client library for Google Cloud Storage — upload, download, and manage buckets and objects programmatically.

SDK
npm
v8.4.0
3,209 stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
98 /100 Excellent
Development Activity 100
Maintenance 96
Community 96
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
85 /100 Excellent
Architecture 87
Code Quality 88
Innovation 84
Learning Curve 82

@google-cloud/storage is Google’s official, hand-written Node.js client for Google Cloud Storage, published from the googleapis/google-cloud-node monorepo (path handwritten/storage). It wraps the GCS JSON/XML API behind a resource-oriented object model — Storage, Bucket, File, HmacKey, Notification, Channel — so applications can create and configure buckets, stream objects up and down, and manage access without hand-rolling HTTP requests.

Beyond basic CRUD, it implements GCS’s resumable upload protocol, multi-part parallel transfers via a dedicated Transfer Manager, V2/V4 signed URLs and signed POST policies, CRC32C/MD5 integrity validation, IAM policy and ACL management, and configurable retry/idempotency strategies — making it the standard choice for any Node.js service that reads or writes data to Cloud Storage.

What You Get

  • A Storage client plus Bucket/File resource objects mirroring GCS’s bucket/object hierarchy, each with getX/setX/createX/deleteX method families
  • Resumable upload support (resumable-upload.ts) and a parallel Transfer Manager for high-throughput multi-file/multi-chunk transfers
  • V2 and V4 signed URL and signed POST policy generation for delegated, time-limited client access without exposing service credentials
  • Built-in CRC32C and MD5 hash validation on upload/download, plus configurable RetryOptions and IdempotencyStrategy for safe automatic retries
  • IAM policy, ACL, HMAC key, Pub/Sub notification, and requester-pays management surfaced as first-class methods on Bucket/Storage
  • Dual ESM/CJS builds, full TypeScript types, and every method offered in both Promise and Node-style callback form

Common Use Cases

  • Serving static website assets or user-uploaded media directly from GCS buckets
  • Streaming large file uploads/downloads (backups, exports, ETL payloads) with resumable transfer guarantees
  • Issuing short-lived signed URLs so browser or mobile clients can upload/download directly to/from a bucket without a credentialed backend proxy
  • Bulk-migrating or syncing large object sets between buckets or local disk using the Transfer Manager’s parallelism
  • Enforcing object-level and bucket-level access control (IAM/ACL) as part of a multi-tenant storage layer

Under The Hood

Architecture — The client is centered on a Storage entry point (src/storage.ts) that extends a shared REST Service base (from the monorepo’s nodejs-common) and factories out Bucket (bucket.ts, ~4.7k lines) and File (file.ts, ~4.7k lines) instances representing GCS resources. Requests flow through shared Google Node.js building blocks — @google-cloud/paginator for list pagination, @google-cloud/promisify for the dual callback/promise surface, and google-auth-library for ADC/service-account auth. Large or resumable transfers are isolated into their own modules: resumable-upload.ts implements GCS’s chunked resumable-upload protocol directly, and transfer-manager.ts (~1k lines) coordinates parallel multi-file/multi-chunk uploads and downloads on top of it.

Tech Stack — TypeScript compiled to dual ESM and CJS output via separate tsconfig.json/tsconfig.cjs.json builds plus a Babel postcompile step, targeting Node >=18. Core runtime dependencies are Google’s own micro-libraries (@google-cloud/paginator, projectify, promisify), gaxios/teeny-request for HTTP transport, google-auth-library for authentication, duplexify/abort-controller for stream control, and fast-xml-parser for XML-API interop. Linting uses Google’s gts (Google TypeScript Style); tests run under Mocha with c8 coverage and sinon/nock/proxyquire/mockery for mocking HTTP and module boundaries.

Code Quality — The test/ directory (~18.4k lines) is nearly as large as src/ (~17.5k lines) and covers every public module (acl, bucket, channel, crc32c, file, hmacKey, iam, notification, resumable-upload, signer, transfer-manager) individually. Source files carry extensive TSDoc with runnable @example blocks embedded directly above nearly every public method. Errors surface as a typed ApiError from the shared nodejs-common layer, and retry behavior is explicit and configurable via RetryOptions/IdempotencyStrategy rather than silently swallowed.

API Design — A single named export, Storage, is instantiated with new Storage() (Application Default Credentials by default, or an explicit key file), and resources are addressed by chaining — storage.bucket(name).file(name) — mirroring GCS’s own hierarchy. Every method is offered in both callback and Promise form via matching XCallback/XResponse type pairs, and naming is consistent across resources (getX/setX/createX/deleteX), keeping the learning curve low for anyone who already knows one resource’s API surface.

Used by 97 apps in this directory

TypeScript
99%
Apache 2.0

Mastra Code

AI Code Assistants

29,041

"A coding agent that never compacts" — a terminal-based AI coding agent built on the Mastra framework, with Observational Memory instead of context compaction, multi-model support, and OAuth login for Claude Max or ChatGPT Plus.

View details
90
Repo Health
73
Technical
65
Dependency
Built with
TypeScript 99%
Updated 5 days ago
TypeScript
99%
Apache 2.0

Mastra Code

AI Code Assistants

29,041

"A coding agent that never compacts" — a terminal-based AI coding agent built on the Mastra framework, with Observational Memory instead of context compaction, multi-model support, and OAuth login for Claude Max or ChatGPT Plus.

View details
90
Repo Health
73
Technical
65
Dependency
Built with
TypeScript 99%
Updated 5 days ago
TypeScript
99%
Apache 2.0

Mastra Code

AI Code Assistants

29,041

"A coding agent that never compacts" — a terminal-based AI coding agent built on the Mastra framework, with Observational Memory instead of context compaction, multi-model support, and OAuth login for Claude Max or ChatGPT Plus.

View details
90
Repo Health
73
Technical
65
Dependency
Built with
TypeScript 99%
Updated 5 days ago
TypeScript
99%
Apache 2.0

Mastra Code

AI Code Assistants

29,041

"A coding agent that never compacts" — a terminal-based AI coding agent built on the Mastra framework, with Observational Memory instead of context compaction, multi-model support, and OAuth login for Claude Max or ChatGPT Plus.

View details
90
Repo Health
73
Technical
65
Dependency
Built with
TypeScript 99%
Updated 5 days ago
TypeScript
88%
Apache 2.0

Medplum

Authentication · Databases · Developer Tools

2,760

An open-source, FHIR-native healthcare platform that gives developers a compliant backend, authentication, a React component library, and serverless bots to build clinical applications in weeks instead of years.

View details
93
Repo Health
90
Technical
71
Dependency
Built with
TypeScript 88%
Updated 5 days ago
TypeScript
88%
Apache 2.0

Medplum

Authentication · Databases · Developer Tools

2,760

An open-source, FHIR-native healthcare platform that gives developers a compliant backend, authentication, a React component library, and serverless bots to build clinical applications in weeks instead of years.

View details
93
Repo Health
90
Technical
71
Dependency
Built with
TypeScript 88%
Updated 5 days ago
TypeScript
92%
Other

n8n

Automation · No Code Platforms

208,437

Code when you need it, UI when you don't — the workflow automation platform built for technical teams who refuse to choose.

View details
95
Repo Health
87
Technical
62
Dependency
Built with
TypeScript 92%
Updated 6 days ago
TypeScript
92%
Other

n8n

Automation · No Code Platforms

208,437

Code when you need it, UI when you don't — the workflow automation platform built for technical teams who refuse to choose.

View details
95
Repo Health
87
Technical
62
Dependency
Built with
TypeScript 92%
Updated 6 days ago
TypeScript
97%
Other

nango

Authentication · Automation · Developer Tools

12,963

Build product integrations with AI using 800+ APIs — auth, proxy, and TypeScript functions on production-grade infrastructure.

View details
94
Repo Health
85
Technical
67
Dependency
Built with
TypeScript 97%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers