create
Of course, you need to register your NPM account with me first
- npm init
First CD into the directory where you want to put the bag,
NPM init then fills in the relevant data
Name: enter the name of the plug-in package. The default is the name of the current folder. Description: Use one sentence to describe the plugin package, such as: ‘A toast plugin for vue’ entry point: Git repository git repository git repository git repository git repository git repository git repository git repository This is the git repository address. If your package was first placed on Github or in another Git repository, if not, press Enter to continue. Keyword: The index keyword of the package is just like the keyword of a Baidu query (just write the key words). Author: name of the author (GitHub name or your favorite name can be optional) License: open source type, usually enter the text box.
Is this ok? Ok, and you’re done
upload
Use NPM login to login to the NPM account at the console
npm login
Copy the code
Go to the package folder and use NPM publish to upload the NPM package
npm publish
Copy the code
delete
NPM unpublish package name @version numberCopy the code
Or use
NPM unpublish package name@version number --forceCopy the code
eg:
NPM unpublish [email protected]Copy the code
In addition, mainly for security reasons, after the Azer NPM unpack event, NPM published a version of the new rules, as follows:
- Packages with version updates less than 24 hours are allowed to be removed from the shelves;
- Removal of bags older than 24 hours should contact the NPM maintainer;
- If there is an NPM maintainer involved, NPM will check if there are other packages that depend on the package and will not allow them to be removed.
- If all versions of a package are removed, NPM uploads an empty placeholder package in case later users accidentally reference a malicious substitute.