{"id":15674586,"url":"https://github.com/transitive-bullshit/abstract-object-storage","last_synced_at":"2025-10-14T19:32:38.143Z","repository":{"id":30978282,"uuid":"126554012","full_name":"transitive-bullshit/abstract-object-storage","owner":"transitive-bullshit","description":"Collection of useful utilities for working with Google Cloud Storage.","archived":false,"fork":false,"pushed_at":"2022-12-09T08:27:53.000Z","size":434,"stargazers_count":14,"open_issues_count":11,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-07T02:24:56.926Z","etag":null,"topics":["bucket","gcp","gcs","google-cloud","google-cloud-storage","object-storage","storage"],"latest_commit_sha":null,"homepage":"","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/transitive-bullshit.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":"2018-03-24T01:09:12.000Z","updated_at":"2024-10-16T22:17:45.000Z","dependencies_parsed_at":"2023-01-14T18:05:32.559Z","dependency_job_id":null,"html_url":"https://github.com/transitive-bullshit/abstract-object-storage","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/transitive-bullshit/abstract-object-storage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transitive-bullshit%2Fabstract-object-storage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transitive-bullshit%2Fabstract-object-storage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transitive-bullshit%2Fabstract-object-storage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transitive-bullshit%2Fabstract-object-storage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/transitive-bullshit","download_url":"https://codeload.github.com/transitive-bullshit/abstract-object-storage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transitive-bullshit%2Fabstract-object-storage/sbom","scorecard":{"id":896997,"data":{"date":"2025-08-11","repo":{"name":"github.com/transitive-bullshit/abstract-object-storage","commit":"c4dc52e61cb77e6d99d72ddfa1224be64282940a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/19 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"62 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-4w2v-q235-vp99","Warn: Project is vulnerable to: GHSA-cph5-m8f7-6c5x","Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx","Warn: Project is vulnerable to: GHSA-jr5f-v2jv-69x6","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-832h-xg76-4gv6","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9","Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm","Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q","Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-pc5p-h8pf-mvwp","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-675m-85rw-j3w4","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9","Warn: Project is vulnerable to: GHSA-w9mr-4mfr-499f","Warn: Project is vulnerable to: GHSA-w7rc-rwvf-8q5r","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-92xj-mqp7-vmcj","Warn: Project is vulnerable to: GHSA-wxgw-qj99-44c2","Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5","Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp","Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq","Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr","Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765","Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-6g33-f262-xjp4","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-29xr-v42j-r956","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T14:06:08.688Z","repository_id":30978282,"created_at":"2025-08-24T14:06:08.688Z","updated_at":"2025-08-24T14:06:08.688Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279019589,"owners_count":26086757,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bucket","gcp","gcs","google-cloud","google-cloud-storage","object-storage","storage"],"created_at":"2024-10-03T15:47:28.902Z","updated_at":"2025-10-14T19:32:38.127Z","avatar_url":"https://github.com/transitive-bullshit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# abstract-object-storage\n\n\u003e Collection of useful utilities for working with [Google Cloud Storage](https://cloud.google.com/storage).\n\n[![NPM](https://img.shields.io/npm/v/abstract-object-storage.svg)](https://www.npmjs.com/package/abstract-object-storage) [![Build Status](https://travis-ci.com/transitive-bullshit/abstract-object-storage.svg?branch=master)](https://travis-ci.com/transitive-bullshit/abstract-object-storage) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\nThe goal is to eventually add support for AWS S3 as well.\n\n## Installation\n\n```\nnpm install --save abstract-object-storage\n# or\nyarn add abstract-object-storage\n```\n\nThis module uses async await and therefore requires node \u003e= 8.\n\n## Usage\n\n```js\nprocess.env.GOOGLE_APPLICATION_CREDENTIALS = '\u003cinsert auth credentials here\u003e'\n\nconst storage = require('abstract-object-storage').defaults({\n  bucket: 'my-test-bucket'\n})\n\nawait storage.uploadFile({\n  key: 'test/example.jpg',\n  localPath: './example.jpg'\n})\n\nconst buffer = await storage.downloadBuffer({\n  key: 'test/example.jpg'\n})\n\n// buffer should equal the contents of './example.jpg'\n```\n\n## API\n\nAll methods take a generic Options Object which may specify auth, bucket, and file properties.\n\n### Options\n\n**Storage authentication** ([gcs docs](https://googlecloudplatform.github.io/google-cloud-node/#/docs/google-cloud/v0.53.0/google-cloud))\n\n- `projectId`\n- `keyFilename`\n- `email`\n- `credentials`\n- `client_email`\n- `private_key`\n- `autoRetry`\n- `maxRetries`\n- `promise`\n\nNote that the preferred way of authenticating with GCS is to use the `GOOGLE_APPLICATION_CREDENTIALS` environment variable, which case, nothing from this section is a required param to `storage`.\n\n---\n\n**Bucket** ([gcs docs](https://googlecloudplatform.github.io/google-cloud-node/#/docs/storage/1.1.0/storage?method=bucket))\n\n- `bucket` - string, required name of bucket to operate against\n\n---\n\n**File** ([gcs docs](https://googlecloudplatform.github.io/google-cloud-node/#/docs/storage/1.1.0/storage/bucket?method=file))\n\n- `key` - string, required name of file in `bucket` to operate against\n\n---\n\n**Path**\n\n- `path` - string, optional `gs://` url including both `bucket` and `key`. Note that specifying a `path` will override any `bucket` or `key` that is specified.\n\n### Convenience Methods\n\nThis module uses the *defaults pattern* similar to node's popular [request](https://github.com/request/request#convenience-methods) module.\n\n`storage.defaults(opts) =\u003e storage`\n\nThis method *returns a wrapper* around the normal `storage` api that defaults to whatever options you pass to it.\n\n**Note**: You can call `.defaults()` on the wrapper that is returned from `storage.defaults` to add/override defaults that were previously defaulted.\n\n### Methods\n\n#### contentLength\n\nReturns the length of the remote file specified by the given `bucket` and `key`.\n\n`storage.contentLength({ key }) =\u003e Promise\u003cNumber\u003e`\n\n#### copyFile\n\nCopies one remote file to another file location. Note that both the `source` and `dest` files are specified via the common parameters specified above and will inherit from values specified on the storage defaults.\n\n`storage.copyFile(source, dest) =\u003e Promise`\n\n#### downloadBuffer\n\nDownloads the remote file specified by the given `bucket` and `key` to a `Buffer`.\n\n`storage.downloadBuffer({ key }) =\u003e Promise\u003cBuffer\u003e`\n\n#### downloadStream\n\nDownloads the remote file specified by the given `bucket` and `key` to a readable stream.\n\n`storage.downloadStream({ key }) =\u003e ReadableStream`\n\n#### downloadFile\n\nDownloads the remote file specified by the given `bucket` and `key` to a local file.\n\n`storage.downloadFile({ key, localPath }) =\u003e Promise`\n\n- `localPath` - string, required path of the destination file\n\n#### getSignedUrl\n\nReturns a signed url to access the remote file specified by the given `bucket` and `key`.\n\nNote that the returned url has a TTL and may have ACLs applied to it.\n\n`storage.getSignedUrl({ key }) =\u003e Promise\u003cString\u003e`\n\n- `options` - object, optional\n- `options.expires` - number | string | date, optional expiration date for the url (defaults to 2 days from `Date.now()`)\n- `options.action` - string, optional acl ([gcs docs](https://googlecloudplatform.github.io/google-cloud-node/#/docs/storage/1.1.0/storage/file?method=getSignedUrl))\n\n#### moveFile\n\nMoves one remote file to another file location. Note that both the `source` and `dest` files are specified via the common parameters specified above and will inherit from values specified on the storage defaults.\n\n`storage.moveFile(source, dest) =\u003e Promise`\n\n#### uploadBuffer\n\nUploads a buffer to the remote file specified by the given `bucket` and `key`.\n\n`storage.uploadBuffer({ key, buffer, metadata, options }) =\u003e Promise`\n\n- `buffer` - Buffer, required Buffer to upload\n- `metadata` - Object, optional resource metadata to be attached to the upload ([gcs docs](https://cloud.google.com/storage/docs/json_api/v1/objects/insert#request_properties_JSON))\n- `options` - Object, optional additional options to customize the upload ([gcs docs](https://googlecloudplatform.github.io/google-cloud-node/#/docs/storage/1.1.0/storage/bucket?method=upload))\n\n#### uploadFile\n\nUploads the contents of a local file to the remote file specified by the given `bucket` and `key`.\n\n`storage.uploadFile({ key, localPath, metadata, options }) =\u003e Promise`\n\n- `localPath` - string, required path of the local source file\n- `metadata` - Object, optional resource metadata to be attached to the upload ([gcs docs](https://cloud.google.com/storage/docs/json_api/v1/objects/insert#request_properties_JSON))\n- `options` - Object, optional additional options to customize the upload ([gcs docs](https://googlecloudplatform.github.io/google-cloud-node/#/docs/storage/1.1.0/storage/bucket?method=upload))\n\n**Note** that `uploadFile` defaults its resource `metadata` to the `content-type` and `content-length` of the local file (via [mime-types](https://www.npmjs.com/package/mime-types)).\n\n#### uploadStream\n\nUploads a readable stream to the file specified by the given `bucket` and `key`.\n\n`storage.uploadStream({ key, stream, metadata, options }) =\u003e Promise`\n\n- `stream` - [stream](https://nodejs.org/api/stream.html#stream_class_stream_readable), required readable stream to upload\n- `metadata` - Object, optional resource metadata to be attached to the upload ([gcs docs](https://cloud.google.com/storage/docs/json_api/v1/objects/insert#request_properties_JSON))\n- `options` - Object, optional additional options to customize the upload ([gcs docs](https://googlecloudplatform.github.io/google-cloud-node/#/docs/storage/1.1.0/storage/bucket?method=upload))\n\n## License\n\nMIT © [Travis Fischer](https://github.com/transitive-bullshit)\n\nSupport my OSS work by \u003ca href=\"https://twitter.com/transitive_bs\"\u003efollowing me on twitter \u003cimg src=\"https://storage.googleapis.com/saasify-assets/twitter-logo.svg\" alt=\"twitter\" height=\"24px\" align=\"center\"\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransitive-bullshit%2Fabstract-object-storage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftransitive-bullshit%2Fabstract-object-storage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransitive-bullshit%2Fabstract-object-storage/lists"}