I try to use these two libraries to detect a NFC tag (https://github.com/mitchellparsons/rc522-rfid-promise) and to control a MPD server (https://github.com/andrewrk/mpd.js) on a Raspberry Pi. I use Node v6.9.5 on Raspbian Jessie (2017-01-11).
When executing the following code only the MPD listener is executed. Is there something I did wrong or misunderstood the concept of Nodejs?
var mpd = require('mpd')
var rc522 = require("rc522-rfid-promise")
var client = mpd.connect({
port: 6600,
host: 'localhost',
})
rc522.startListening()
.then(function(rfidTag){
console.log('Got RFID tag')
})
client.on('ready', function() {
console.log("MPD ready")
})
Thank you!