JavaScript implementation of Teleport