31
loading...
This website collects cookies to deliver better user experience
npm init
which will ask you a bunch of questions that is not compulsory. Just hit enter to complete those.You can change it later.npm init -y
which will create a file named package.json with the defaults."version": "1.0.0"
"description": "A package to work with strings"
"keywords": [
"react",
"Javascript"
]
"homepage": "https://github.com/owner/project#readme"
"bugs":{
"url" : "https://github.com/owner/project/issues",
"email" : "[email protected]"
}
"author": "[email protected] https://www.abc.com/",
"contributors": [{
"name": "example",
"email": "[email protected]",
"url": "https://www.example.com/#team"
}]
(email and url are optional).
"scripts":{
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"lint": "eslint ./"
}
"dependencies": {
"react": "^17.0.1",
"react-router-dom": "^5.2.0",
"compression": "~1.7.4"
}
npm install --save-dev <packagename>
"private": true
"engines": {
"node": ">= 6.0.0",
"npm": ">= 3.0.0",
"yarn": "^0.13.0"
}
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
import something from 'something'
, the file you named in this key will be the one gets imported."main": "src/main.js"