{"id":20181788,"url":"https://github.com/nichoth/blob-store","last_synced_at":"2026-02-14T11:37:11.380Z","repository":{"id":37526448,"uuid":"505943152","full_name":"nichoth/blob-store","owner":"nichoth","description":"Store blobs","archived":false,"fork":false,"pushed_at":"2024-09-23T21:50:05.000Z","size":386,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-08T20:00:27.547Z","etag":null,"topics":[],"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/nichoth.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-21T17:33:02.000Z","updated_at":"2022-09-05T22:48:28.000Z","dependencies_parsed_at":"2025-01-13T17:22:56.243Z","dependency_job_id":"b8780e48-4d63-433a-a389-e6b3fcd43a0d","html_url":"https://github.com/nichoth/blob-store","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"6e15efcde858258e7a62f864378dc12eb95ec8e2"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/nichoth/blob-store","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nichoth%2Fblob-store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nichoth%2Fblob-store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nichoth%2Fblob-store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nichoth%2Fblob-store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nichoth","download_url":"https://codeload.github.com/nichoth/blob-store/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nichoth%2Fblob-store/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275225865,"owners_count":25427000,"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-09-15T02:00:09.272Z","response_time":75,"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":[],"created_at":"2024-11-14T02:36:44.935Z","updated_at":"2026-02-14T11:37:06.354Z","avatar_url":"https://github.com/nichoth.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# blob-store\n\nStore blobs in a content-addressed way. This uses [@nichoth/multihash](https://github.com/nichoth/multihash) to create a unique hash for any file.\n\nSo far have only implemented a backend via [cloudinary](https://www.npmjs.com/package/cloudinary), but it would be good to implement other backends as well.\n\n## install\n\n```\nnpm i -S @nichoth/blob-store\n```\n\n## example\n\n```js\nrequire('dotenv').config()\nconst BlobStore = require('@nichoth/blob-store/cloudinary')\nconst cloudinaryUrl = require('@nichoth/blob-store/cloudinary/url')\nimport { scale } from \"@cloudinary/url-gen/actions/resize\";\nconst test = require('tape')\n\ntest('create a blob store', t =\u003e {\n    // this wraps the package 'cloudinary'\n    // takes the same config object\n    const blobStore = BlobStore({\n        cloud_name: process.env.CLOUDINARY_CLOUD_NAME,\n        api_key: process.env.CLOUDINARY_API_KEY,\n        api_secret: process.env.CLOUDINARY_API_SECRET\n    })\n\n    t.ok(blobStore, 'should create a blobStore')\n    t.end()\n})\n\nvar _hash\ntest('blobstore.write', t =\u003e {\n    blobStore.write(file)\n        // get a hash here for a given file\n        .then(({ hash, response }) =\u003e {\n            _hash = hash\n            t.ok(hash.includes('.sha256'),\n                'should return hash, and create a sha256 hash as default')\n            t.ok(response, 'should return http response')\n            t.equal(response.public_id, hash, 'should use the hash as filename')\n            t.end()\n        })\n        .catch(err =\u003e {\n            t.fail(err)\n            t.end()\n        })\n})\n\ntest('get a URL', t =\u003e {\n    // this wraps the package '@cloudinary/url-gen'\n    // takes the same config object\n    const cld = cloudinaryUrl({\n        cloud: { cloudName: process.env.CLOUDINARY_CLOUD_NAME },\n        url: {\n            secure: true // force https, set to false to force http\n        }\n    })\n\n    const url = (cld\n        .image(_hash)\n        .resize( scale().width(100) )\n        .toURL())\n\n    console.log(url)\n    // =\u003e https://res.cloudinary.com/nichoth/image/upload/GmuzSvBeEBT5tvt1vhtRkhl1a7V8MkTqCxT4Z4jFz_s.sha256?_a=ATAMhUk0\n\n    t.ok(url.includes('https'), 'should return an https URL')\n    t.ok(url.includes(_hash), 'url should include the right filename')\n    t.end()\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnichoth%2Fblob-store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnichoth%2Fblob-store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnichoth%2Fblob-store/lists"}