Listen for the cordova deviceready callback in any environment
$ npm install --save cordova-deviceready
var onDeviceReady =
Function to be called once the device is ready. If the device is already ready, it will be called instantly.
MIT © Andrew Joslin