Sohail Si Sohail Si - 2 months ago 9
Node.js Question

How to tell the version number of RxJS

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 ?

Answer

You could do something like:

const package = require('rxjs/package.json');
const is5 = /^5\./.test(package.version);

console.log(package.version);
console.log(is5);