NOVELTY - Method comprises performing membrane separation including: providing membrane (1215) having a feed side and permeate side being selective for methane over nitrogen; passing a gas stream (1213) comprising methane and nitrogen across the feed side of the membrane; withdrawing from the feed side a residue stream (1216) depleted in methane and enriched in nitrogen compared with the gas stream; withdrawing from the permeate side a permeate stream (1217) enriched in methane and depleted in nitrogen.    USE - A membrane separation process for treating a gas stream containing methane and nitrogen.    ADVANTAGE - The invention is a simple method to extract value from gas streams with high nitrogen content that might otherwise be very difficult to make use of.    DETAILED DESCRIPTION - The method also uses at least a portion of the permeate stream as combustion fuel in a driver; and using the driver to drive an electric power generator. Method further includes: cooling a gas stream comprising methane, nitrogen and at least one C3+ hydrocarbon, thereby condensing at least a portion of the C3+ hydrocarbon; withdrawing the portion as a C3+ hydrocarbon enriched product; expanding the residue stream in an expander thereby cooling it, then passing the residue stream in heat-exchanging relationship against the incoming gas stream to provide at least part of the cooling; using at least a portion of the permeate stream as combustion fuel in a turbine (1224); and using the turbine to drive an electric power generator (1228). An INDEPENDENT CLAIM is also included for an apparatus for generating electric power.    DESCRIPTION OF DRAWING(S) - The drawing shows an embodiment that includes an NGL recovery step.    Stream (1201)    Heat exchanger (1202)    Chilled stream (1205)    Separator (1206)    Condensed liquid bottoms stream (1207)    Expansion valve (1208)    Expanded stream (1209)    Liquids bottoms stream (1211)    Overhead stream (1212, 1213)    Membrane unit (1214)    Permeate stream (1217)    Expanded residue stream (1219)    Compressor (1222)    Turbine (1224)    Generator (1228)