I watching Kitchen Renovations today and the host was installing a small central vac unit in a closet converted into a pantry. The unit had a 3 prong cord.
The host cut a hole in the wall to recess the unit and also cut the plug off the cord, fed it through a hole in a stud and said "We could plug the unit into an outlet, but we'll let the electrician wire it into the existing outlet on the other side of this wall."
Is it code compliant to wire a small appliance in this manner? Can I cut the plugs off my toaster oven, coffee maker, etc. and hardwire them onto a junction box?