How to make an outline around a single pixel on HTML5 Canvas similar to what’s seen on r/place

I’ve been trying to draw an outline around a single pixel on a canvas but I cant seem to get it right. Any idea’s how something like this is implemented on r/place. I read their article https://www.redditinc.com/blog/how-we-built-rplace but unfortunately no implementation details are there for the rectangle drawing. I’m guessing they did something clever with scaling.

Attached image below for reference.

enter image description here