An E _ { \gamma, { jet } } \propto { E ^ { \prime } _ { p } } ^ { 1.5 } relationship with a small scatter for current \gamma -ray burst ( GRB ) data was recently reported , where E _ { \gamma, { jet } } is the beaming-corrected \gamma -ray energy and E ^ { \prime } _ { p } is the \nu F _ { \nu } peak energy in the local observer frame . By considering this relationship for a sample of 12 GRBs with known redshift , peak energy , and break time of afterglow light curves , we constrain the mass density of the universe and the nature of dark energy . We find that the mass density \Omega _ { M } = 0.35 \pm ^ { 0.15 } _ { 0.15 } ( at the 1 \sigma confident level ) for a flat universe with a cosmological constant , and the w parameter of an assumed static dark-energy equation of state w = -0.84 \pm ^ { 0.57 } _ { 0.83 } ( 1 \sigma ) . Our results are consistent with those from type Ia supernovae . A larger sample established by the upcoming Swift satellite is expected to provide further constraints .