{"id":21937776,"url":"https://github.com/atayahmet/blobify","last_synced_at":"2025-03-22T14:25:29.712Z","repository":{"id":57099454,"uuid":"174535150","full_name":"atayahmet/blobify","owner":"atayahmet","description":"A Javascript automation tool to convert data (file, image etc.) to blob object and vice-versa.","archived":false,"fork":false,"pushed_at":"2019-03-25T13:45:18.000Z","size":105,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-17T20:11:24.662Z","etag":null,"topics":["blob","blob-files","blob-image","chunking","data-chunk","inmemory-cache"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/atayahmet.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}},"created_at":"2019-03-08T12:36:39.000Z","updated_at":"2023-06-18T22:40:17.000Z","dependencies_parsed_at":"2022-08-20T19:10:44.641Z","dependency_job_id":null,"html_url":"https://github.com/atayahmet/blobify","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atayahmet%2Fblobify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atayahmet%2Fblobify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atayahmet%2Fblobify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atayahmet%2Fblobify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atayahmet","download_url":"https://codeload.github.com/atayahmet/blobify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244968552,"owners_count":20540144,"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","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":["blob","blob-files","blob-image","chunking","data-chunk","inmemory-cache"],"created_at":"2024-11-29T01:25:36.304Z","updated_at":"2025-03-22T14:25:29.689Z","avatar_url":"https://github.com/atayahmet.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Blobify\nA Javascript automation tool to convert from html file object to blob object and more capabilities with creating custom helper function.\n\n[![npm version](https://badge.fury.io/js/%40atayahmet%2Fblobify.svg)](https://badge.fury.io/js/%40atayahmet%2Fblobify)\n[![Build Status](https://travis-ci.org/atayahmet/blobify.svg?branch=master)](https://travis-ci.org/atayahmet/blobify.svg?branch=master)\n[![Dependency Status](https://img.shields.io/david/atayahmet/storage-based-queue.svg?style=flat-square)](https://david-dm.org/atayahmet/storage-based-queue)\n[![Known Vulnerabilities](https://snyk.io/test/github/atayahmet/blobify/badge.svg?targetFile=package.json)](https://snyk.io/test/github/atayahmet/blobify?targetFile=package.json)\n[![GitHub license](https://img.shields.io/github/license/atayahmet/storage-based-queue.svg)](https://github.com/atayahmet/blobify/blob/master/LICENSE)\n[![GitHub issues](https://img.shields.io/github/issues/atayahmet/storage-based-queue.svg)](https://github.com/atayahmet/blobify/issues)\n\n## Getting Started\n\n```ts\nimport { chunk } from '@atayahmet/blobify';\n\nchunk({ chars: stream, slice: 128, type: 'image/jpg' })\n```\n\n### Installing\n\n```sh\nnpm i @atayahmet/blobify --save\n```\nor\n\n```sh\nyarn add @atayahmet/blobify\n```\n\n## Running the tests\n\n```ts\nnpm test\n```\n\n### Built-in Helpers\n\n| Name         | Parameter Type | Return                 | Description                             |\n|--------------|----------------|------------------------|-----------------------------------------|\n| pipe         | Function       | Blobify class instance | Pipe itarator.                          |\n| createBlob   | string[]       | Blob                   | Create blob object from chunks.         |\n| chunk        | IChunkOptions  | Uint8Array[]           | Chunk generator.                        |\n| base64Encode | File           | Promise\u0026lt;string\u0026gt;  | HTML5 File object.                      |\n| base64Decode | string         | any                    | Base64 encoded data.                    |\n| toStream     | Blob           | Promise\u0026lt;string\u0026gt;  | Convert blob object to readable content.|\n\n### IChunkOptions\n\n| Name   | Type                 | Description                   |\n|--------|----------------------|-------------------------------|\n| chunks | string or Uint8Array | Data format.                  |\n| slice  | number (optional)    | Per chunk size. (Default 512) |\n| type   | string               | File content type.            |\n\n## Quick Example\n\nConvert the file to uploadable form.\n\n```ts\nimport { pipe, chunk, createBlob, base64Encode } from '@atayahmet/blobify';\n\nconst file = document.getElementById('image');\n\npipe(() =\u003e base64Encode(file))\n  .pipe(stream =\u003e chunk({ chars: stream, slice: 128 }))\n  .pipe(chunks =\u003e createBlob(chunks, \"image/jpeg\"))\n  .catch(console.error)\n  .run()\n  .then(resul =\u003e {\n    console.log(result);\n  });\n```\n\nVice versa:\n\n```ts\npipe(() =\u003e toStream(blob))\n  .pipe(stream =\u003e base64Decode(stream))\n  .pipe(data =\u003e {\n      // do some maniplation...\n      return data;\n  })\n  .run()\n  .then(result =\u003e {\n    // ...\n  });\n```\n\n## Built With\n\n* [TypeScript](https://www.typescriptlang.org) \n\n## Versioning\n\nWe use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags). \n\n## Authors\n\n* [**Ahmet ATAY**](https://github.com/atayahmet) - *Initial work*\n\nSee also the list of [contributors](https://github.com/your/project/contributors) who participated in this project.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatayahmet%2Fblobify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatayahmet%2Fblobify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatayahmet%2Fblobify/lists"}