{"id":15006416,"url":"https://github.com/artskydj/create-temp-file","last_synced_at":"2025-10-30T11:30:39.896Z","repository":{"id":25095419,"uuid":"28516441","full_name":"ArtskydJ/create-temp-file","owner":"ArtskydJ","description":":floppy_disk: Returns a write stream to a new temporary file","archived":false,"fork":false,"pushed_at":"2023-03-08T17:59:44.000Z","size":46,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-25T07:00:30.328Z","etag":null,"topics":["dir","directory","file","javascript","js","node","stream","temp","temporary","write"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArtskydJ.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":"2014-12-26T17:12:11.000Z","updated_at":"2024-06-19T01:30:24.041Z","dependencies_parsed_at":"2024-06-19T01:30:20.836Z","dependency_job_id":"9c683485-0d7e-4cb7-9319-bbdfa582412d","html_url":"https://github.com/ArtskydJ/create-temp-file","commit_stats":{"total_commits":58,"total_committers":4,"mean_commits":14.5,"dds":0.2586206896551724,"last_synced_commit":"69448e7f62a841ad888201d77d4a47629746b201"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtskydJ%2Fcreate-temp-file","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtskydJ%2Fcreate-temp-file/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtskydJ%2Fcreate-temp-file/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtskydJ%2Fcreate-temp-file/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArtskydJ","download_url":"https://codeload.github.com/ArtskydJ/create-temp-file/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238955818,"owners_count":19558455,"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":["dir","directory","file","javascript","js","node","stream","temp","temporary","write"],"created_at":"2024-09-24T19:01:53.233Z","updated_at":"2025-10-30T11:30:34.564Z","avatar_url":"https://github.com/ArtskydJ.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"create-temp-file\n================\n\n\u003e A tiny node module that creates a temporary file, returns a write stream, a path, and cleanup functions\n\n[![Build Status](https://travis-ci.org/ArtskydJ/create-temp-file.svg)](https://travis-ci.org/ArtskydJ/create-temp-file)\n\n# example\n\n```js\nvar createTempFile = require('create-temp-file')\n\nvar ws = createTempFile()\nprocess.stdin.pipe(ws)\n\nprocess.on('exit', ws.cleanupSync)\n```\n\n# api\n\n```js\nvar createTempFile = require('create-temp-file')\n```\n\n## `var ws = createTempFile([extension])`\n\nYou can set the file `extension` for the temp file, or don't set an extension. E.g. `'.png'`.\n\n`ws` is a [write stream](https://nodejs.org/api/fs.html#fs_class_fs_writestream) to the new temporary file with the following properties:\n\n- `ws.path` is the absolute path to the temporary file. E.g. `'/tmp/b285e724-226c-11e5-9981-82bd40254040.png'`\n- `ws.cleanup([cb])` deletes the temporary file. Like [`fs.unlink`](https://nodejs.org/api/fs.html#fs_fs_unlink_path_callback)\n- `ws.cleanupSync` deletes the temporary file synchronously. Like [`fs.unlinkSync`](https://nodejs.org/api/fs.html#fs_fs_unlinksync_path)\n\nIf an error occurs in `ws.cleanup()` or `ws.cleanupSync()`, the error will be emitted. Catch any errors like this:\n\n```js\nws.on('error', function (e) {\n\tthrow e\n})\n```\n\n# install\n\nWith [npm](https://nodejs.org/en/download/) do:\n\n    npm install create-temp-file\n\n# license\n\n[VOL](http://veryopenlicense.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartskydj%2Fcreate-temp-file","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartskydj%2Fcreate-temp-file","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartskydj%2Fcreate-temp-file/lists"}