react npm 包
If you ever want to publish your own library, you will need to upload a new project onto Github.
如果您想发布自己的库,则需要将新项目上载到Github。
In this tutorial, I will teach all of you how to create your own react project, upload it to GitHub, create another react project, and uploading the initially created project as a package.
在本教程中,我将教大家如何创建自己的React项目,将其上传到GitHub,创建另一个React项目以及将最初创建的项目作为包上传。
To begin, you need to install node on your machine with the following command:
首先,您需要使用以下命令在计算机上安装节点:
curl “https://nodejs.org/dist/latest/node-${VERSION:-$(wget -qO- https://nodejs.org/dist/latest/ | sed -nE ‘s|.*>node-(.*)\.pkg</a>.*|\1|p’)}.pkg” > “$HOME/Downloads/node-latest.pkg” && sudo installer -store -pkg “$HOME/Downloads/node-latest.pkg” -target “/”
卷曲“ https://nodejs.org/dist/latest/node-${VERSION:-$(wget -qO- https://nodejs.org/dist/latest/ | sed -nE's |。*> node -(。*)\。pkg </a>。* | \ 1 | p')}。pkg”>“ $ HOME / Downloads / node-latest.pkg” && sudo安装程序-store -pkg“ $ HOME / Downloads /node-latest.pkg”-目标“ /”
Now create a folder and create index.js. Index.js is where you will be exporting your functions from the package.
现在创建一个文件夹并创建index.js。 Ind