I am trying to create Electron app which can manage Airplay on MacOS
I am using Angular and TypeScript to wrap APIs from this npm package Airplay npm package :
this is the code I am using in TypeScript :
export class AirplaySharing {
public init() {
const airplayer = window['require']('airplayer');
const list = airplayer();
list.on('update', function(player) {
console.log('Found new AirPlay device:', player.name);
});
}
}
I get this error while calling init()
Error: Cannot find module 'airplayer'
at Module._resolveFilename
at Function.Module._resolveFilename
at Function.Module._load
at Module.require
at require
at t.init
at new t
at bs
at gs
at Ys
npm install airplayer --save? - LearnToday