Skip to content
File System API for Local/GitHub.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
src feat(fs): add cwd option Jun 2, 2019
test fix(fs): create dir by mkdirp Jun 2, 2019
.gitignore initial commit Jun 2, 2019
LICENSE initial commit Jun 2, 2019 Update README Jun 2, 2019
package.json 1.1.0 Jun 2, 2019
tsconfig.json initial commit Jun 2, 2019
yarn.lock initial commit Jun 2, 2019

korefile Build Status

korefile: コレ・ファイル

File System API for Local/GitHub.


  • Write/Read/Delete API for Local/GitHub
  • Plugabble adaptor


Install with npm:

npm install korefile


Korefile apply KoreFileAdaptor implementation.


Read/Write/Delete for local file system. It wrap fs module.

import {createKoreFile, createFsAdaptor} from "korefile";
const koreFile = createKoreFile({ 
    adaptor: createFsAdaptor()
(async () => { 
    // write
    await koreFile.writeFile("/path/to/file", "content");
    // read
    const content = await koreFile.readFile("/path/to/file");
    // delete
    await koreFile.deleteFile("/path/to/file");


Read/Write/Delete for GitHub repository. It wrap octokit/rest.js.

Require GitHub Auth Token.

import {createKoreFile, createGitHubAdaptor} from "korefile";
const koreFile = createKoreFile({
    adaptor: createGitHubAdaptor({
        owner: "azu",
        repo: "korefile",
        ref: "heads/test",
        token: process.env.GH_TOKEN
(async () => { 
    // file path should be relative
    const testFilePath = "file.test";
    // write
    await koreFile.writeFile(testFilePath, input);
    // read
    const content = await koreFile.readFile(testFilePath);
    // delete
    await koreFile.deleteFile(testFilePath);


See Releases page.

Running tests

Install devDependencies and Run npm test:

npm test


Pull requests and stars are always welcome.

For bugs and feature requests, please create an issue.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D



MIT © azu

You can’t perform that action at this time.