emulate keyup and keydown on nodejs