{"id":14261331,"url":"https://github.com/azu/korefile","last_synced_at":"2025-04-15T11:54:14.198Z","repository":{"id":48509288,"uuid":"189796134","full_name":"azu/korefile","owner":"azu","description":"File System API for Local/GitHub.","archived":false,"fork":false,"pushed_at":"2023-10-14T03:01:47.000Z","size":110,"stargazers_count":31,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T19:45:14.735Z","etag":null,"topics":["api","browser","filesystem","fs","github","node","octokit"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/azu.png","metadata":{"funding":{"github":"azu"},"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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-02T02:21:16.000Z","updated_at":"2024-08-20T02:49:45.000Z","dependencies_parsed_at":"2024-06-19T00:25:13.052Z","dependency_job_id":"c5b04b71-90ff-40e7-a543-518d78fffaaf","html_url":"https://github.com/azu/korefile","commit_stats":{"total_commits":35,"total_committers":3,"mean_commits":"11.666666666666666","dds":"0.11428571428571432","last_synced_commit":"6fe50011ca9051db7983eeb201e3021fae66b677"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azu%2Fkorefile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azu%2Fkorefile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azu%2Fkorefile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azu%2Fkorefile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/azu","download_url":"https://codeload.github.com/azu/korefile/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248862829,"owners_count":21173894,"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":["api","browser","filesystem","fs","github","node","octokit"],"created_at":"2024-08-22T13:01:00.397Z","updated_at":"2025-04-15T11:54:14.170Z","avatar_url":"https://github.com/azu.png","language":"TypeScript","funding_links":["https://github.com/sponsors/azu"],"categories":["browser"],"sub_categories":[],"readme":"# korefile [![Actions Status: test](https://github.com/azu/korefile/workflows/test/badge.svg)](https://github.com/azu/korefile/actions?query=workflow%3A\"test\")\n \n\u003e korefile: コレ・ファイル\n \nFile System API for Local/GitHub.\n\n## Features\n\n- Write/Read/Delete API for Local/GitHub\n- Pluggable adaptor\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n    npm install korefile\n\n## Usage\n\nKorefile apply [KoreFileAdaptor](./src/KoreFileAdaptor.ts) implementation. \n\n### FsAdaptor\n\nRead/Write/Delete for local file system.\nIt wraps `fs` module.\n\n```js\nimport {createKoreFile, createFsAdaptor} from \"korefile\";\nconst koreFile = createKoreFile({ \n    adaptor: createFsAdaptor()\n});\n(async () =\u003e { \n    // write\n    await koreFile.writeFile(\"/path/to/file\", \"content\");\n    // read\n    const content = await koreFile.readFile(\"/path/to/file\");\n    // delete\n    await koreFile.deleteFile(\"/path/to/file\");\n})()\n```\n\n### GitHubAdaptor\n\nRead/Write/Delete for GitHub repository.\nIt wrap [octokit/rest.js](https://github.com/octokit/rest.js/).\n\nRequire [GitHub Auth Token](https://github.com/settings/tokens/new).\n\n```js\nimport {createKoreFile, createGitHubAdaptor} from \"korefile\";\nconst koreFile = createKoreFile({\n    adaptor: createGitHubAdaptor({\n        owner: \"azu\",\n        repo: \"korefile\",\n        ref: \"heads/test\",\n        token: process.env.GH_TOKEN\n    })\n});\n(async () =\u003e { \n    // file path should be relative\n    const testFilePath = \"file.test\";\n    // write\n    await koreFile.writeFile(testFilePath, input);\n    // read\n    const content = await koreFile.readFile(testFilePath);\n    // delete\n    await koreFile.deleteFile(testFilePath);\n})();\n```\n\n## UseCase\n\n- [asocial-bookmark](https://github.com/azu/asocial-bookmark)\n- [github-funding-yml-updater](https://github.com/azu/github-funding-yml-updater)\n\n## Changelog\n\nSee [Releases page](https://github.com/azu/korefile/releases).\n\n## Running tests\n\nInstall devDependencies and Run `npm test`:\n\n    npm test\n\n## Contributing\n\nPull requests and stars are always welcome.\n\nFor bugs and feature requests, [please create an issue](https://github.com/azu/korefile/issues).\n\n1. Fork it!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request :D\n\n## Author\n\n- [github/azu](https://github.com/azu)\n- [twitter/azu_re](https://twitter.com/azu_re)\n\n## License\n\nMIT © azu\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazu%2Fkorefile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazu%2Fkorefile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazu%2Fkorefile/lists"}