please delete me
please delete me

Reputation: 111

How to get Meteor Package information within the app?

Is it possible to get a list of all available packages and their configuration within a running MeteorJS app.

I don't mean the CLI command meteor list but something that could let me check if certain packages are available or not and change the programs behaviour accordingly.

Upvotes: 0

Views: 43

Answers (1)

tarmes
tarmes

Reputation: 15442

Yes.

Using code from the meteorhacks SSR package as an example, you can see that it does this to check for the existence of the Jade package:

if(Package['mquandalle:jade-compiler']) {
  Compilers.jade = Package['mquandalle:jade-compiler'].JadeCompiler;
}

The caveat is that the other package has to be added first.

Upvotes: 1

Related Questions