{"id":17472687,"url":"https://github.com/shinnn/node-read-remove-file","last_synced_at":"2025-03-28T08:10:46.946Z","repository":{"id":23373692,"uuid":"26735070","full_name":"shinnn/node-read-remove-file","owner":"shinnn","description":"Read a file, then remove it","archived":false,"fork":false,"pushed_at":"2018-11-04T20:41:40.000Z","size":91,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-03T12:16:10.236Z","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/shinnn.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":"2014-11-17T01:37:52.000Z","updated_at":"2022-05-31T08:56:35.000Z","dependencies_parsed_at":"2022-07-08T04:18:03.472Z","dependency_job_id":null,"html_url":"https://github.com/shinnn/node-read-remove-file","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fnode-read-remove-file","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fnode-read-remove-file/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fnode-read-remove-file/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fnode-read-remove-file/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shinnn","download_url":"https://codeload.github.com/shinnn/node-read-remove-file/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245991582,"owners_count":20706129,"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-10-18T17:33:47.515Z","updated_at":"2025-03-28T08:10:46.922Z","avatar_url":"https://github.com/shinnn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# read-remove-file\n\n[![npm version](https://img.shields.io/npm/v/read-remove-file.svg)](https://www.npmjs.com/package/read-remove-file)\n[![Build Status](https://travis-ci.org/shinnn/node-read-remove-file.svg?branch=master)](https://travis-ci.org/shinnn/node-read-remove-file)\n[![Coverage Status](https://coveralls.io/repos/github/shinnn/node-read-remove-file/badge.svg?branch=master)](https://coveralls.io/github/shinnn/node-read-remove-file?branch=master)\n\nRead a file, then remove it\n\n```javascript\nconst {access} = require('fs').promises;\nconst readRemoveFile = require('read-remove-file');\n\n(async () =\u003e {\n  const buf = await readRemoveFile('path/to/a/file'); //=\u003e \u003cBuffer ... \u003e\n  await access('path/to/a/file'); // Error: ENOENT\n})();\n```\n\n## Installation\n\n[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/getting-started/what-is-npm).\n\n```\nnpm install read-remove-file\n```\n\n## API\n\n```javascript\nconst readRemoveFile = require('read-remove-file');\n```\n\n### readRemoveFile(*path* [, *options*])\n\n*path*: `string` `Buffer` `Uint8Array` `URL` (a file path) or `integer` (a file descriptor)  \n*options*: `Object` or `string` ([`fs.readFile`][readFile] options)  \nReturn: `Promise\u003cBuffer|string\u003e`\n\nIt [reads a file][readFile], [removes it](https://nodejs.org/api/fs.html#fs_fs_unlink_path_callback) and returns a `Promise` of the file contents.\n\n## License\n\n[ISC License](./LICENSE) © 2018 Shinnosuke Watanabe\n\n[readFile]: https://nodejs.org/api/fs.html#fs_fs_readfile_path_options_callback\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinnn%2Fnode-read-remove-file","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshinnn%2Fnode-read-remove-file","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinnn%2Fnode-read-remove-file/lists"}