isomorphic-git / lightning-fs

A lean and fast 'fs' for the browser
MIT License
476 stars 47 forks source link

Access to path module from browser #47

Open jcubic opened 4 years ago

jcubic commented 4 years ago

I'm using dist/lightning-fs.min.js from https://cdn.jsdelivr.net/ and it seems that path module is not exposed. It would be nice if you don't need to use browser-fs just to have path.join and path.split.

Or is there a way to access it?

billiegoose commented 4 years ago

Try npm install path-browserify :-)

jcubic commented 4 years ago

It don't work with just browser, it have node.js require in output files the same as lighting-fs you can't use it for instance in Codepend using some npm CDN service.

Also lighting-fs don't have dist written in ES5 (actually use lot of latest JS like async..await in dist directory), so if you want to support some old browser you need to use Babel on node_modules which you usually disable.

jcubic commented 4 years ago

So lighthing-fs is not actually replacement for BrowserFS you can't use it in the same way. BrowserFS is broken because you can't actually ise path in service worker but this is not good alternative.