Yeah, it's not illegal but it will stink to high heaven. Best to mix it with carbon waste (wood chips, leaves, etc) and make good compost.
A few years ago there was a big problem in NJ with a company that expanded from accepting yard wastes to also accepting food wastes for composting. The new owners had great plans & even had a contract to supply methane gas to nearby McGuire Air Force base. Great idea, poor execution. The owners did not follow correct composting procedures. Nutrient runoff and odor where such big problems that the operation was shut down. Due to this experience, the State has been very strict on composting facilities.So composting is illegal in New Jersey! Wouldn't have ever thought the EPA would be against it.