write my own js library