If you feel threatened, be as loud as you can, and struggle unless you have a weapon pointed at you. Make it undesirable to be bothered with. Throw up if you can. Then it can be moved out of the way, and entry is easy. Use a deadbolt with 2 sided keyhole if you have a door with a window next to the door knob.
Burglars often break the window and then reach in and unlock the door.
If you have a key lock next to the window, this type of entry is useless.