Check out example codes for "custom scripts in package.json". It will help you in understanding the concepts better.

Code Example 1

"scripts": {
    "homedata": "node export.js homedata",
  },
 //In the terminal type
 npm run homedata

Learn ReactJs, React Native from akashmittal.com