The sheer bulk of the commands are the same from the command line regardless of the the platform you use to develop. The official guide here is essentially the develop Cordova apps using OS X (or linux):
https://cordova.apache.org/docs/en/latest/guide/cli/index.html
If you want to target iOS then use:
https://cordova.apache.org/docs/en/latest/guide/platforms/ios/index.html
Yes there are many user-made plugins too. I think this is tutorial for creating one: https://cordova.apache.org/docs/en/2.5.0/guide/plugin-development/. I am out of development with cordova and they changed a website a little so I am not sure. But you will need knowledge about native programing in specific mobile OS (Android, iOS) to create a custom plugin. Many plugins are on github so a little search is required to find them. Oh, I forget about Cordova plugin registry: https://cordova.apache.org/plugins/. You can search for pluigns there. Good luck!
That seems pretty arbitrary. Can you check if this happens because you are keeping some pointers to memory? Maybe look over your variables. Also check if the file size is different on another device where more or less memory may be available. I believe you can even set the available memory in the chrome developer tools. Also, your device may restrict the file size you are allowed to create in which case this code is irrelevant. You may have to change your App Manifest to get more space or change the destination where you're saving the file to. Large files should be written to an external storage location. There's a specification for that for both Android and iOS.
Edit: if you haven't done so before, maybe have a look at this documentation: https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file/index.html#create-a-persistent-file-
Hey, there is a tutorial about how to make a chat room with rethinkdb here. It's for a mobile app but maybe you can find some useful info anyway :)