The New Jersey Department of Community Affairs has these recommendations for portable generators:

• Never run a generator within a basement, garage or any enclosed or partially enclosed structure as this will lead to a dangerous and often fatal accumulation of carbon monoxide. Never position a generator too close to your home's windows and doors. 

• Use battery-operated carbon monoxide alarms. Test and change the batteries at regular intervals.

• Never connect a generator directly to your home's wiring unless your home has been wired for generator use. This can cause backfeeding along power lines and electrocute anyone coming in contact with them, including lineworkers making repairs. Have a licensed electrician install the equipment necessary to safely connect emergency generators to your home.

•Turn off all equipment powered by the generator before shutting it down. 

• Keep the generator dry. Operate it on a dry surface under an open structure. 

• Always have a fully charged fire extinguisher nearby.

• Never fuel a generator while it is operating.

As far as permanent generators, some towns, like Verona, have requirements that need to be met before one is installed:
Click here for info

• Before purchasing a natural gas-fueled generator, have PSE&G confirm that your natural gas service can supply the new generator. 

•Provide one copy of property survey showing location of generator. Due to the recent increase in inquiries and building-permit applications for standby electric generators, pending action by the Township council, standby electric generators in residential zoning districts will be required to be located in the rear yard only due to the objectionable noise levels associated with their operation. 

• Provide a letter of approval from condominium association if applicable.