From 9aeaee05b08d0f45841d7047573d2399f17354f2 Mon Sep 17 00:00:00 2001 From: ION606 Date: Wed, 22 May 2024 20:41:35 -0400 Subject: [PATCH] added README --- README.md | 35 +++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..957ebca --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +# Github to File System (gh-to-fs) +This package allows a user to interact with the github api as if using the `fs` module. + + +# Differences +- ANY synchronous function (i.e. `writeFileSync`, `readFileSync`, etc) **MUST** be awaited +- The module must be initialized (see below) + +# A Simple Example +```Javascript +// import the project +import customFs from 'github-to-fs'; + +// create the custom FS object +const cfs = new customFs('https://api.github.com/repos/ION606/github-to-fs', token); + +// write the file to the repo +await cfs.writeFileSync('example.txt', 'hello world!'); + +// read the contents of the file +console.log((await cfs.readFileSync('example.txt')).toString()); + +// remove the file +await cfs.rmSync('example.txt'); + +// make sure the file is gone +console.log((await cfs.readFileSync('example.txt')).toString()); +``` + +# Common Errors +## 409 +This is a github error that happens seemingly at random. I can not control this and +it is currently a known problem with the GitHub API + +- Created by ION606 \ No newline at end of file diff --git a/package.json b/package.json index 97d53ee..91dbc83 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "github-to-fs", - "version": "1.0.0", + "version": "1.0.1", "description": "a package that allows you to use github like file storage", "main": "customFileSystem.js", "scripts": {