Search code examples
javascriptnode.jsrxjsrxjs5

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 ?


Solution

  • You could do something like:

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