Creating an OP_CSV transaction with bitcoinjs
In bitcoin-js you could do something like this

aliceToBobRedeemScript =  bitcoin.script.compile([,
bitcoin.opcodes.OP_IF,
  bitcoin.opcodes.OP_HASH160,
  aliceSecretHash,
  bitcoin.opcodes.OP_EQUALVERIFY,
  bobPrivKey.getPublicKeyBuffer(),
bitcoin.opcodes.OP_ELSE,
  bitcoin.script.number.encode(10),
  bitcoin.opcodes.OP_NOP3,
  bitcoin.opcodes.OP_DROP, 
  alicePrivKey.getPublicKeyBuffer(),
bitcoin.opcodes.OP_ENDIF,
bitcoin.opcodes.OP_CHECKSIG
]);


there is some sample code on an old atomicswap demo, it doesnt have csv but shows other things such as how to sign custom transactions etc

https://github.com/rubensayshi/counterparty-p2sh-demo/blob/master/atomic-swap.js#L163-L185