The README is super confusing. How do I use this in the browser?
See original GitHub issueThis library looks great, but the only clues the README provides for using this library in the browser are broken or confusing.
The Installation section only explains how to use Node.
The example code for the browser (the code that loads a bunch of stuff from unpkg.com
) does not work (if I copy, paste and run the code, the then
method just logs undefined
).
The README claims you can do stuff like import git from 'isomorphic-git'
, but there’s no export named git
(or a default) in the module I have. I probably have the wrong module, but the README provides no clue where to get one from, so I tried the CDN from the broken example code.
I’d ideally like to use this library (and Lightning FS) as ES6 modules, and need to load them from a local server (in development), but do not even know which files I need (I’ve been doing Web development for over ten years, and normally have no trouble with stuff like this).
Any advice would be appreciated. Thanks.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
@carlyounger if you want to avoid using NPM, you can also utilize something like an NPM CDN to download the file in-browser:
https://cdn.jsdelivr.net/npm/isomorphic-git@1.8.1/index.umd.min.js
@carlyounger you don’t have to bundle yourself is what I’m saying. If you run
npm i isomorphic-git
and then look in yournode_modules
, you will find a pre-prepared.umd.min.js
file. If you’re using webpack (or any other bundler), you can simply import from there:It’s just a slight modification of the typical import