suchipi / fs-remote Goto Github PK
View Code? Open in Web Editor NEW๐ก Drop-in replacement for fs that lets you write to the filesystem from the browser
License: MIT License
๐ก Drop-in replacement for fs that lets you write to the filesystem from the browser
License: MIT License
Thanks for the work on this!
I followed the readme and tried to get started, but:
const createClient = require("fs-remote/createClient")
threw a 'require is not defined' error.
I'm of course now looking into how to solve client-side requiring, but it'd be nice to mention in the readme that require won't work out of the box and giving some pointers for what to do to get this up and running :)
Could help new programmers quickly work out how to get up and running with this!
Thank you for this plugin, love the simplicity of the API.
I've been unable to use it with isomorphic-git - and I would really appreciate any pointers that you might have for me. This is the stack trace:
TypeError: Cannot read property 'serialize' of undefined
at eval (tuple.js:28)
at Array.map (<anonymous>)
at Object.serialize (tuple.js:27)
at Object.serialize (decorateTypeDef.js:15)
at Object.serialize (union.js:33)
at Object.serialize (decorateTypeDef.js:15)
at Object.writeFile (client.js:36)
at P (index.js:32)
at new Promise (<anonymous>)
at FileSystem.eval (index.js:6)
Running a plain fs.writeFileSync()
worked, so I'm guessing the server-client setup is in order. The isomorphic-git lib also works with browserFS, so I'm guessing there's something different about this that you could shed some light on. This is a relevant docs link. Attaching my code snippet below:
import * as git from "isomorphic-git";
const createClient = require("fs-remote/createClient");
export const init = () => {
const fs = createClient("http://localhost:3000");
git.plugins.set("fs", fs);
git
.clone({
dir: "test-repo",
corsProxy: "https://cors.isomorphic-git.org",
url: "https://github.com/karigari/really-large-repo",
singleBranch: true,
depth: 1
})
.then(r => console.log("done", r))
.catch(e => console.log("error", e));
};
Happy to provide any info that you might need to debug this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.