{"id":15645774,"url":"https://github.com/jaydenseric/extract-files","last_synced_at":"2025-04-05T05:06:12.625Z","repository":{"id":45014336,"uuid":"96856492","full_name":"jaydenseric/extract-files","owner":"jaydenseric","description":"A function to recursively extract files and their object paths within a value, replacing them with null in a deep clone without mutating the original value. FileList instances are treated as File instance arrays. Files are typically File and Blob instances.","archived":false,"fork":false,"pushed_at":"2022-08-29T06:59:07.000Z","size":218,"stargazers_count":53,"open_issues_count":1,"forks_count":24,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-14T04:37:27.211Z","etag":null,"topics":["esm","graphql","maintained","mjs","node","npm","typescript"],"latest_commit_sha":null,"homepage":"https://npm.im/extract-files","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/jaydenseric.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":".github/funding.yml","license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"jaydenseric"}},"created_at":"2017-07-11T06:01:02.000Z","updated_at":"2024-03-29T04:14:32.000Z","dependencies_parsed_at":"2022-09-17T23:20:23.530Z","dependency_job_id":null,"html_url":"https://github.com/jaydenseric/extract-files","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Fextract-files","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Fextract-files/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Fextract-files/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Fextract-files/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaydenseric","download_url":"https://codeload.github.com/jaydenseric/extract-files/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289426,"owners_count":20914464,"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":["esm","graphql","maintained","mjs","node","npm","typescript"],"created_at":"2024-10-03T12:09:48.141Z","updated_at":"2025-04-05T05:06:12.598Z","avatar_url":"https://github.com/jaydenseric.png","language":"JavaScript","readme":"# extract-files\n\nA function to recursively extract files and their object paths within a value, replacing them with `null` in a deep clone without mutating the original value. [`FileList`](https://developer.mozilla.org/en-US/docs/Web/API/Filelist) instances are treated as [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) instance arrays. Files are typically [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) and [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) instances.\n\nUsed by [GraphQL multipart request spec client implementations](https://github.com/jaydenseric/graphql-multipart-request-spec#implementations) such as [`graphql-react`](https://npm.im/graphql-react) and [`apollo-upload-client`](https://npm.im/apollo-upload-client).\n\n## Installation\n\nFor [Node.js](https://nodejs.org), to install [`extract-files`](https://npm.im/extract-files) with [npm](https://npmjs.com/get-npm), run:\n\n```sh\nnpm install extract-files\n```\n\nFor [Deno](https://deno.land) and browsers, an example import map:\n\n```json\n{\n  \"imports\": {\n    \"extract-files/\": \"https://unpkg.com/extract-files@13.0.0/\",\n    \"is-plain-obj\": \"https://unpkg.com/is-plain-obj@4.1.0/index.js\",\n    \"is-plain-obj/\": \"https://unpkg.com/is-plain-obj@4.1.0/\"\n  }\n}\n```\n\nSee the function [`extractFiles`](./extractFiles.mjs) to get started.\n\n## Requirements\n\nSupported runtime environments:\n\n- [Node.js](https://nodejs.org) versions `^14.17.0 || ^16.0.0 || \u003e= 18.0.0`.\n- [Deno](https://deno.land), importing from a CDN that might require an import map for dependencies.\n- Browsers matching the [Browserslist](https://browsersl.ist) query [`\u003e 0.5%, not OperaMini all, not dead`](https://browsersl.ist/?q=%3E+0.5%25%2C+not+OperaMini+all%2C+not+dead).\n\nNon [Deno](https://deno.land) projects must configure [TypeScript](https://typescriptlang.org) to use types from the ECMAScript modules that have a `// @ts-check` comment:\n\n- [`compilerOptions.allowJs`](https://typescriptlang.org/tsconfig#allowJs) should be `true`.\n- [`compilerOptions.maxNodeModuleJsDepth`](https://typescriptlang.org/tsconfig#maxNodeModuleJsDepth) should be reasonably large, e.g. `10`.\n- [`compilerOptions.module`](https://typescriptlang.org/tsconfig#module) should be `\"node16\"` or `\"nodenext\"`.\n\n## Exports\n\nThe [npm](https://npmjs.com) package [`extract-files`](https://npm.im/extract-files) features [optimal JavaScript module design](https://jaydenseric.com/blog/optimal-javascript-module-design). It doesn’t have a main index module, so use deep imports from the ECMAScript modules that are exported via the [`package.json`](./package.json) field [`exports`](https://nodejs.org/api/packages.html#exports):\n\n- [`extractFiles.mjs`](./extractFiles.mjs)\n- [`isExtractableFile.mjs`](./isExtractableFile.mjs)\n","funding_links":["https://github.com/sponsors/jaydenseric"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaydenseric%2Fextract-files","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaydenseric%2Fextract-files","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaydenseric%2Fextract-files/lists"}