{"id":21558118,"url":"https://github.com/koopjs/koop-filesystem-local","last_synced_at":"2025-10-08T18:45:28.203Z","repository":{"id":143883286,"uuid":"56263308","full_name":"koopjs/koop-filesystem-local","owner":"koopjs","description":"A local filesystem plugin for Koop that keeps all file actions confined to a single root directory","archived":false,"fork":false,"pushed_at":"2022-12-09T21:14:17.000Z","size":26,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-06-03T21:01:49.669Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/koopjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2016-04-14T19:06:57.000Z","updated_at":"2020-07-30T12:34:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"8cd4b2e6-5d8e-4b24-90b0-1461e2906387","html_url":"https://github.com/koopjs/koop-filesystem-local","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koopjs%2Fkoop-filesystem-local","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koopjs%2Fkoop-filesystem-local/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koopjs%2Fkoop-filesystem-local/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koopjs%2Fkoop-filesystem-local/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koopjs","download_url":"https://codeload.github.com/koopjs/koop-filesystem-local/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koopjs%2Fkoop-filesystem-local/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259101237,"owners_count":22805235,"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-11-24T08:14:02.637Z","updated_at":"2025-10-08T18:45:28.116Z","avatar_url":"https://github.com/koopjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Koop Local FS\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/koopjs/koop-filesystem-local.svg)](https://greenkeeper.io/)\n*A filesystem plugin for koop that supports setting a root directory for all actions*\n\n[![npm][npm-img]][npm-url]\n[![travis][travis-image]][travis-url]\n\n## Project goal\n\nIn order to allow different koop modules to write to local disk without specifying a machine specific absolute path, this module resolves all relative paths to the same base directory. So you can call`koop.fs.createReadStream('foo.txt')` and always know that you can open foo without changing the working directory.\n\n## Usage\n\n### In `default.json`\n\n```json\n{\n  \"filesystem\": {\n    \"local\": {\n      \"rootDir\": \"/var/koop/files\"\n    }\n  }\n}\n```\n\n### In `server.js`\n\n```javascript\nconst config = require('config')\nconst koop = require('koop')(config)\nconst LocalFs = require('koop-localfs')\n\nkoop.register(LocalFs)\n```\n\n## Supported functions\n\n- stat - Get information about a file\n- createReadStream: create a readable stream from a file on disk\n- createWriteStream: create a writeable stream you can pipe to\n- writeFile: write a file to disk\n- readFile: read a file from disk\n- unlink: delete a file\n- mkdir: make a directory\n- rmdir: remove an empty directory\n- rmdirp: recursively remove a directory and its contents\n- realpathSync: resolve the absolute path when given a relative path\n\n\n[npm-img]: https://img.shields.io/npm/v/koop-localfs.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/koop-localfs\n[travis-image]: https://img.shields.io/travis/koopjs/koop-filesystem-local.svg?style=flat-square\n[travis-url]: https://travis-ci.org/koopjs/koop-filesystem-local\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoopjs%2Fkoop-filesystem-local","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoopjs%2Fkoop-filesystem-local","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoopjs%2Fkoop-filesystem-local/lists"}