Reputation: 2976
How to tell the version of the installed RxJS from the code? For example:
var Rx = require('rxjs/Rx');
console.log(Rx.rev); // undefined
console.log(Rx.version); // undefined
Second question: How to tell if it's rxjs5 ?
Upvotes: 17
Views: 24452
Reputation: 380
You can install the 'version-check' library from npm using
npm install -g version-check
And then call
version-check rxjs
Hope this solves your problem.
Upvotes: 17
Reputation: 3528
This will show all NPM package versions if you installed with NPM.
npm list --depth=0
If you leave out the --depth then you'll get all their dependencies also.
Upvotes: 28
Reputation: 32117
You could do something like:
const package = require('rxjs/package.json');
const is5 = /^5\./.test(package.version);
console.log(package.version);
console.log(is5);
Upvotes: 4