How to convert a keyPair to JSON and back?
Wallet Import Format can be used in a Javascript String,  which is JSON compatible.
For bitcoinjs-lib@^2.0.0:


  var prv = keyPair.toWIF()


To recover, use


  bitcoin.ECPair.fromWIF(prv)


Caution: if you store your private key in an insecure location, your funds will be insecure. fromWIF/toWIF does not provide any form 
of protection.