Sohail Si
Sohail Si

Reputation: 2976

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 ?

Upvotes: 17

Views: 24452

Answers (4)

Werthis
Werthis

Reputation: 1117

Try and check on the list

ng --version

Upvotes: 1

Arpan Srivastava
Arpan Srivastava

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

Preston
Preston

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

Ben Fortune
Ben Fortune

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

Related Questions