{"id":26777281,"url":"https://github.com/timothymeadows/storagepooljs","last_synced_at":"2025-10-14T17:25:42.937Z","repository":{"id":96219764,"uuid":"123999535","full_name":"TimothyMeadows/storagepooljs","owner":"TimothyMeadows","description":"This is a javascript library designed to run in all desktop, and mobile browsers that can support the IndexedDB API. It functions much like most cloud based Storage API's that exist separating data between containers, and blobs.","archived":false,"fork":false,"pushed_at":"2018-03-08T01:07:58.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-11T18:52:56.033Z","etag":null,"topics":["browser","file","filestorage","filesystem","storagepool"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TimothyMeadows.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2018-03-06T01:02:15.000Z","updated_at":"2020-05-17T19:08:24.000Z","dependencies_parsed_at":"2023-04-27T14:47:21.708Z","dependency_job_id":null,"html_url":"https://github.com/TimothyMeadows/storagepooljs","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/TimothyMeadows/storagepooljs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimothyMeadows%2Fstoragepooljs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimothyMeadows%2Fstoragepooljs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimothyMeadows%2Fstoragepooljs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimothyMeadows%2Fstoragepooljs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TimothyMeadows","download_url":"https://codeload.github.com/TimothyMeadows/storagepooljs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimothyMeadows%2Fstoragepooljs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279020079,"owners_count":26086806,"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":["browser","file","filestorage","filesystem","storagepool"],"created_at":"2025-03-29T04:49:23.228Z","updated_at":"2025-10-14T17:25:42.932Z","avatar_url":"https://github.com/TimothyMeadows.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# storagepool.js\n\nThis is a javascript library designed to run in all desktop, and mobile browsers that can support the [IndexedDB API](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API). It functions much like most cloud based Storage API's that exist separating data between containers, and blobs.\n\nThis library is capable of large file storage in the browser. You can reach 500 MB in both desktop, and mobile browsers without any notices or warnings. Moving beyond 500 MB may result in a prompt from the browser to the user requesting if they will allow more space to be stored. Some mobile browsers will deny any attempt to store more than 1 GB of space regardless of the users input.\n\n### StoragePool(contianerName:string, containerVersion:number):Promise\n\n- *containerName:string* \u003cbr/\u003e\nThis is the name of the container you which to access. It will be created if it does not already exist.\n\n- (optional) *containerVersion:number* \u003cbr/\u003e\nThis is the storage container version. This is an optional parameter and best left alone. However, changing the value can be used as a quick way to drop, and re-create the storage pool rather than deleting all items that might exist in that pool.\n\nAt the root of storagepool.js is the StoragePool constructor. It's safe to use as both a class, or a function. I personally tend to use it more as a function than a class as you will see in the examples. The method will return a Promise that on success will return a StorageContainer object.\n\n#### Example\n```javascript\nStoragePool(\"test-container\").then(function (container) { /* ... */ });\n```\n\n### StorageContainer.count():Promise\n\nThis method will return a count of all of the items in the storage container. This is an optimized method rather than depending on StorageContainer.list().length.\n\n#### Example\n```javascript\nStoragePool(\"test-container\").then(function (container) {\n    container.count().then(function (count) {\n        console.log(\"file count: \" + count);\n    });\n});\n```\n\n### StorageContainer.list():Promise\n\nThis method will return a list of all of the items in the storage container. The array will contain the path of all items.\n\n#### Example\n```javascript\nStoragePool(\"test-container\").then(function (container) {\n    container.list().then(function (list) {\n        for (var i = 0; i \u003c= list.length - 1; i++) {\n            console.log(i + \": \" + list[i])\n        }\n    });\n});\n```\n\n### StorageBlob(path:string):Class\n\nAt the heart of storagepool.js is the StorageBlob class. This class represents a \"file\" inside of the \"filesystem\" in the form of a Blob.\n\n- *path:string* \u003cbr/\u003e\nThis is the path, including file name to the location you wish to access.\n\n#### Example\n```javascript\nStoragePool(\"test-container\").then(function (container) {\n    var blob = new container.StorageBlob(\"/test/path/test.doc\");\n});\n```\n\n### StorageBlob.write(value:*):Promise\n\nThis will write the contents of value to the StorageBlob path. The contents can be anything however complex JavaScript objects should be pre-encoded in JSON before storage to prevent any issues or exposure of properties not meant to be public. Will return when write is complete.\n\n- *value:** \u003cbr/\u003e\nThis is the content of the StorageBlob you wish to write. It can be anything including a Buffer, Array, string, Blob etc..\n\n#### Example\n```javascript\nStoragePool(\"test-container\").then(function (container) {\n    var blob = new container.StorageBlob(\"/test/path/test.txt\");\n    \n    blob.write(\"caw caw caw\").then(function () {\n        console.log(\"test.txt was writen!\");\n    });\n});\n```\n\n### StorageBlob.fetch(url:string):Promise\n\nThis writes the contents returned in http status 200 to the StorageBlob path. The contents should be a virtual url path, or an http / https url with which you have CORS rights to access. Will return when download, and write are complete.\n\n- *url:string* \u003cbr/\u003e\nThis is the url you wish to fetch a blob from. Due to CORS you should use either virtual paths such as /images/image.png or fully qualified URLs if you know you have proper access rights from the domain you are running storagepool.js from.\n\n#### Example\n```javascript\nStoragePool(\"test-container\").then(function (container) {\n    var blob = new container.StorageBlob(\"/test/path/test.png\");\n    \n    blob.fetch(\"my-logo-black-small.png\").then(function () {\n        console.log(\"test.png was writen!\");\n    });\n});\n```\n\n### StorageBlob.read():Promise\n\nThis will read the contents at the StorageBlob path. Will return undefined if no content is found. Best to use StorageBlob.exists() first if you are unsure if a file is there as it's better optimized.\n\n#### Example\n```javascript\nStoragePool(\"test-container\").then(function (container) {\n    var blob = new container.StorageBlob(\"/test/path/test.txt\");\n    \n    blob.read().then(function (file) {\n        console.log(file);\n    });\n});\n```\n\n### StorageBlob.delete():Promise\n\nThis will delete the contents of the StorageBlob path. Will return when the delete is completed.\n\n#### Example\n```javascript\nStoragePool(\"test-container\").then(function (container) {\n    var blob = new container.StorageBlob(\"/test/path/test.txt\");\n    \n    blob.delete().then(function () {\n        console.log(\"test.txt has been removed.\");\n    });\n});\n```\n\n### StorageBlob.exists():Promise\n\nThis will check if the StorageBlob contains a path. This is an optimized method. Will return true if a path exists, and false if one does not.\n\n#### Example\n```javascript\nStoragePool(\"test-container\").then(function (container) {\n    var blob = new container.StorageBlob(\"/test/path/test.txt\");\n    \n    blob.exists().then(function (exists) {\n        console.log(\"exists: \" + exists);\n    });\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimothymeadows%2Fstoragepooljs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimothymeadows%2Fstoragepooljs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimothymeadows%2Fstoragepooljs/lists"}