extract files from rpm packages

These days I am developing a feature involving rpm packages. Sometimes I need to extract the files from the rpm package instead of installing it. I mark the command here for further reference.

rpm2cpio demo.rpm | cpio -idmv