在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:azu/korefile开源软件地址:https://github.com/azu/korefile开源编程语言:TypeScript 99.7%开源软件介绍:korefile
File System API for Local/GitHub. Features
InstallInstall with npm:
UsageKorefile apply KoreFileAdaptor implementation. FsAdaptorRead/Write/Delete for local file system.
It wraps 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");
})() GitHubAdaptorRead/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);
})(); UseCaseChangelogSee Releases page. Running testsInstall devDependencies and Run
ContributingPull requests and stars are always welcome. For bugs and feature requests, please create an issue.
AuthorLicenseMIT © azu |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论