{"id":26715056,"url":"https://github.com/luislobo/filename-temp-track","last_synced_at":"2025-03-27T13:51:52.583Z","repository":{"id":23979510,"uuid":"100308998","full_name":"luislobo/filename-temp-track","owner":"luislobo","description":"File name tracking in temporary directory and auto clean up","archived":false,"fork":false,"pushed_at":"2024-06-22T08:03:37.000Z","size":206,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T05:51:54.932Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/luislobo.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":"2017-08-14T20:58:58.000Z","updated_at":"2022-09-09T04:24:38.000Z","dependencies_parsed_at":"2023-01-14T00:10:35.262Z","dependency_job_id":null,"html_url":"https://github.com/luislobo/filename-temp-track","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luislobo%2Ffilename-temp-track","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luislobo%2Ffilename-temp-track/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luislobo%2Ffilename-temp-track/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luislobo%2Ffilename-temp-track/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luislobo","download_url":"https://codeload.github.com/luislobo/filename-temp-track/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245858843,"owners_count":20684057,"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":"2025-03-27T13:51:51.978Z","updated_at":"2025-03-27T13:51:52.573Z","avatar_url":"https://github.com/luislobo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# File name tracking in temporary directory and auto clean up\n\nKeeps track of filenames, saved in a temporary folder, and automatically cleans up by default in an hour\n\nUseful when receiving files being uploaded, or downloaded, that needs to be cleaned up after some time or\nwhen the process exits\n\n## Install\n\n```bash\nnpm install filename-temp-track\n```\nor\n```\nyarn filename-temp-track\n```\n\n## Use\n\n\n### track(filename, cleanupTimeout, inDirectory)\nTracks a filename, under a temporary folder, and deletes it after an hour, by default.\n- `filename`: string with the file name. If inDirectory is false, this is the full path of the file to track.\n  It can also be an object with all the same properties as the method signature (see second example below)\n- `cleanuptimeout`: number in ms after which to delete the file\n- `inDirectory`: boolean (default true)\n- Returns a Promise with the full path name, including the base temporary directory.\n\nExample 1: \n```javascript\n// Tracks for a filename, using the default timeout of an hour\nft.track('filename.xls')\n  .then(function(pathName){ // pathName should be /tmp/sometemp/filename.xls});\n```\n\nExample 2: \n```javascript\n// Tracks for a filename, using a custom timeout of a minute\nft.track({filename: 'filename.xls', cleanupTimeout: 1000 * 60})\n  .then(function(pathName){ // pathName should be /tmp/sometemp/filename.xls});\n```\n\n### cleanupFile(pathname)\nCleans up the pathname\n- `pathname`: is the full path name of the file to cleaned up\n- Returns a Promise \n\n### cleanupFileSync(pathname)\nCleans up the pathname (sync version)\n- `pathname`: is the full path name of the file to cleaned up\n- Returns undefined\n\n### cleanupAll()\nCleans up all the files being controlled by this module\n\n### cleanupAllSync()\nCleans up all the files being controlled by this module (sync version)\n\n### getFilesBeingTracked()\nReturns the array of files being tracked\n\n## History\n\n### 2.0.0\n- Refactor into Class\n- Adds `inDirectory` optional parameter\n\n### 1.0.0\n- Initial version\n\n## Contributors\n- [Mudrekh Godeyra](https://github.com/Mudrekh)\n\n## License\nMIT - Copyright (c) 2017, 2019 - Luis Lobo Borobia \u003cluislobo@gmail.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluislobo%2Ffilename-temp-track","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluislobo%2Ffilename-temp-track","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluislobo%2Ffilename-temp-track/lists"}