{"id":17227030,"url":"https://github.com/paranoidjk/egg-tmpfs","last_synced_at":"2025-04-14T01:13:12.705Z","repository":{"id":32926290,"uuid":"146555736","full_name":"paranoidjk/egg-tmpfs","owner":"paranoidjk","description":"A plugin for egg which help to create and auto clean temp folder when request finish or error","archived":false,"fork":false,"pushed_at":"2024-10-08T01:48:38.000Z","size":25,"stargazers_count":5,"open_issues_count":2,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-27T15:13:52.222Z","etag":null,"topics":["egg","egg-plugin","eggjs","fs","nodejs"],"latest_commit_sha":null,"homepage":null,"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/paranoidjk.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":"2018-08-29T06:32:49.000Z","updated_at":"2023-03-16T05:40:12.000Z","dependencies_parsed_at":"2022-08-31T08:20:11.259Z","dependency_job_id":null,"html_url":"https://github.com/paranoidjk/egg-tmpfs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paranoidjk%2Fegg-tmpfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paranoidjk%2Fegg-tmpfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paranoidjk%2Fegg-tmpfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paranoidjk%2Fegg-tmpfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paranoidjk","download_url":"https://codeload.github.com/paranoidjk/egg-tmpfs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248706055,"owners_count":21148634,"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":["egg","egg-plugin","eggjs","fs","nodejs"],"created_at":"2024-10-15T04:17:55.725Z","updated_at":"2025-04-14T01:13:12.639Z","avatar_url":"https://github.com/paranoidjk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# egg-tmpfs\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/paranoidjk/egg-tmpfs.svg)](https://greenkeeper.io/)\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![Test coverage][codecov-image]][codecov-url]\n[![David deps][david-image]][david-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n[![npm download][download-image]][download-url]\n\n[npm-image]: https://img.shields.io/npm/v/egg-tmpfs.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/egg-tmpfs\n[travis-image]: https://img.shields.io/travis/paranoidjk/egg-tmpfs.svg?style=flat-square\n[travis-url]: https://travis-ci.org/paranoidjk/egg-tmpfs\n[codecov-image]: https://img.shields.io/codecov/c/github/paranoidjk/egg-tmpfs.svg?style=flat-square\n[codecov-url]: https://codecov.io/github/paranoidjk/egg-tmpfs?branch=master\n[david-image]: https://img.shields.io/david/paranoidjk/egg-tmpfs.svg?style=flat-square\n[david-url]: https://david-dm.org/paranoidjk/egg-tmpfs\n[snyk-image]: https://snyk.io/test/npm/egg-tmpfs/badge.svg?style=flat-square\n[snyk-url]: https://snyk.io/test/npm/egg-tmpfs\n[download-image]: https://img.shields.io/npm/dm/egg-tmpfs.svg?style=flat-square\n[download-url]: https://npmjs.org/package/egg-tmpfs\n\n\u003c!--\nDescription here.\n--\u003e\n\n## Install\n\n```bash\n$ npm i egg-tmpfs --save\n```\n\n## Usage\n\n```js\n// {app_root}/config/plugin.js\nexports.tmpfs = {\n  enable: true,\n  package: 'egg-tmpfs',\n};\n```\n\n## Configuration\n\n```js\n// {app_root}/config/config.default.js\nexports.tmpfs = {\n  baseTmpPath: '/foo/bar',\n};\n```\n\nsee [config/config.default.js](config/config.default.js) for more detail.\n\n## api\n\n#### ctx.tmpfs.ensureDir(dir[,options][,callback])\n\nsame as [fsextra.ensureDir](https://github.com/jprichardson/node-fs-extra/blob/master/docs/ensureDir.md), but path will based on `config.tmpfs.baseTmpPath`, and the created folder will be auto cleand when request is finished or errored.\n\n\n#### ctx.tmpfs.mark(path)\n\njust incase you have to use original node fs module, then you can create file first, then mark it need to be delete.\n\n#### ctx.tmpfs.unmark(path)\n\nto revert what `ctx.tmpfs.mark(path)` did.\n\n#### ctx.tmpfs.clean()\n\nclean all tmp folders, return a Promise\n\n\u003e Generally, you do not need to use this :) egg-tmpfs will auto call clean.\n\n## Example\n\nsee [test](/test/fixtures/apps/tmpfs-test/app/controller/home.js)\n\n## Questions \u0026 Suggestions\n\nPlease open an issue [here](https://github.com/eggjs/egg/issues).\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparanoidjk%2Fegg-tmpfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparanoidjk%2Fegg-tmpfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparanoidjk%2Fegg-tmpfs/lists"}