RxJS with Promises

I wanted to explore creating reactive handler to promises in RxJS (5). For this example we will create an async request that queries the github api to get some information about user. The Github api call is wrapped inside a promise. From this promise we can use the RxJs fromPromise method to build the observable. As the request is fullfilled and we get a response back from github the observer will fire and print out some data to the console.

const Rx = require('rxjs/Rx');
const request = require('request');

let source$={};
const stdin = process.openStdin();
function prompt() {
  stdin.write('\n\nEnter github id: ' );
};
prompt();
const options = {
 headers: {
  'User-Agent': 'node'
 }
}
const apiGetterPromise = function(username) {
  return new Promise((resolve, reject) => {
      options.url = `https://api.github.com/users/${username}`;
      console.log('-------Making the Request--------');
      console.log(`Using Url: ${JSON.stringify(options)}` );
      request(options, function(error, response, body){
        console.log(`STATUS: ${response.statusCode}`)
         if(error || (response && response.statusCode == 404)){
            reject("User Not Found!!");
         }else {
           resolve(body); 
         }
      });
  });
}
function printGithubData(){
  source$.subscribe(
    data => {
       console.log('--------------Response Received----------');
       let json = JSON.parse(data);
       console.log(json.name);
       console.log(json.blog);
       console.log(json.bio);
       console.log(json.public_repos);
    },
    err => {
       console.log(`Error occurred: ${err}`);
       prompt();
    },
    complete => {
       console.log('-------Request Completed--------\n');
       prompt();
    }
  );
}


stdin.addListener("data", function(input){
   source$ = Rx.Observable.fromPromise(apiGetterPromise(input.toString().trim()));
   printGithubData();
});