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 ?
The latest version of RxJS is v6. It is version 6, which is released recently, and we are doing this tutorial in RxJS version 6. We know that RxJS is used to deal with reactive programming. It is common and most often used with Angular and ReactJS.
First up, RxJS 7.4 is now the default for apps created with ng new. Existing apps using RxJS v6. x will have to manually update using the npm install [email protected] command. But why didn't angular updated their package.
import { of } from 'rxjs; import { map } from 'rxjs/operators'; map(x => x * x)(of(1, 2, 3)). subscribe((v) => console. log(`Output is: ${v}`)); When we go to execute the above code in command prompt, using command − node testrx.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With