{"id":18338771,"url":"https://github.com/tableflip/pull-file-reader","last_synced_at":"2025-04-09T20:35:49.123Z","repository":{"id":72910889,"uuid":"81449208","full_name":"tableflip/pull-file-reader","owner":"tableflip","description":"Read an HTML5 File object (from e.g. HTML5 drag and drops) as a pull stream source.","archived":false,"fork":false,"pushed_at":"2017-05-31T09:07:14.000Z","size":6,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-15T12:46:45.505Z","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":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tableflip.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":"2017-02-09T12:42:43.000Z","updated_at":"2018-11-30T13:30:07.000Z","dependencies_parsed_at":"2023-05-26T01:15:46.718Z","dependency_job_id":null,"html_url":"https://github.com/tableflip/pull-file-reader","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Fpull-file-reader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Fpull-file-reader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Fpull-file-reader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Fpull-file-reader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tableflip","download_url":"https://codeload.github.com/tableflip/pull-file-reader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248108353,"owners_count":21049117,"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":[],"created_at":"2024-11-05T20:15:20.801Z","updated_at":"2025-04-09T20:35:49.098Z","avatar_url":"https://github.com/tableflip.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pull-file-reader [![dependencies Status](https://david-dm.org/tableflip/pull-file-reader/status.svg)](https://david-dm.org/tableflip/pull-file-reader)\n\nGiven an HTML5 File object (from e.g. HTML5 drag and drops), turn it into a pull stream source.\n\nHeavily based on [filereader-stream](https://github.com/maxogden/filereader-stream) by [@maxogden](https://github.com/maxogden).\n\n# install\n\nUse it with npm \u0026 [browserify](https://github.com/substack/node-browserify)\n\n```bash\nnpm install pull-file-reader\n```\n\n# example\n\n```js\nvar drop = require('drag-and-drop-files')\nvar pull = require('pull-stream')\nvar fileReader = require('pull-file-reader')\n\ndrop(document.body, function (files) {\n  var first = files[0]\n  pull(\n    fileReader(first),\n    pull.collect(function (err, buffs) {\n      var contents = Buffer.concat(buffs)\n      // contents is the contents of the entire file\n    })\n  )\n})\n\n```\n\n# usage\n\n```js\nvar fileReader = require('pull-file-reader')\nvar source = fileReader(file, [options])\n```\n\n`fileReader` is a [pull stream](https://github.com/pull-stream/pull-stream) [source](https://github.com/pull-stream/pull-stream#source-aka-readable).\n\n`options`:\n\n* `chunkSize` - default `1024 * 1024` (1MB) - How many bytes will be read at a time\n* `offset` - default `0` - Where in the file to start reading\n\n# run the tests\n\n```\nnpm install\nnpm test\n```\n\nthen open your browser to the address provided, open your JS console, and drag and drop files onto the page until the test suite passes/fails\n\n----\n\nA [(╯°□°）╯︵TABLEFLIP](https://tableflip.io) side project.\n\n[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftableflip%2Fpull-file-reader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftableflip%2Fpull-file-reader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftableflip%2Fpull-file-reader/lists"}