convert examples in readme to js