First off, I am a beginner to all this so please bear with me. I am having difficulty using a package that I found on NPM. I am trying to use some git commands within my Meteor application and am using this package:
On startup of my meteor application, I want to add a submodule if it does not already exist. So as the thread title mentions, how do I use this package? Compared to the examples, I have no idea how make it work.
Can I do something like this(?):
import { Meteor } from 'meteor/meteor';
import SimpleGit from 'simple-git';
Meteor.startup(() => {
// code...
SimpleGit.submoduleAdd('someRepo', '.');
});
Its not clear for me too. I tried to use various client side libraries from npm but its not working out so far. I saw also saw few other question about how to use npm but didn’t see any answers that would clearly explain how to use npm libs.
I haven’t used Simple Git but from the index.js source it looks like it’s exporting a function. The docs confirm this as well (using require syntax). So in your example your imported SimpleGit reference is really pointing to a function. So you could try something like: