What was Peter Pan before it became a book?

It was a play. The author JM Barrie so loved children that he handed over the rights to Peter Pan, to Great Ormond Street Hospital for Children, London. That means that whenever and wherever Peter Pan is performed, the hospital receives the royalties.