lightning-fs icon indicating copy to clipboard operation
lightning-fs copied to clipboard

Access to path module from browser

Open jcubic opened this issue 5 years ago • 3 comments

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?

jcubic avatar May 03 '20 09:05 jcubic

Try npm install path-browserify :-)

billiegoose avatar May 04 '20 16:05 billiegoose

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 avatar May 04 '20 17:05 jcubic

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.

jcubic avatar May 04 '20 17:05 jcubic