create

Of course, you need to register your NPM account first
  • npm initCopy the code

    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.





Version: The version of the package you want to distribute. The default is 1.0.0


Description: Describe the plugin package in one sentence, e.g. ‘A toast plugin for vue’


The default is index.js. You can also customize the file name (lib/index.js).


Test command: Test command. You can enter the command directly


Git repository: This is the git repository address. If your package is stored 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: Author name (GitHub name or preferred name is optional)


License: Open source. Generally, enter the license file.
Is this ok? Ok, and you’re done


upload

Use NPM login to login to the NPM account at the console
npm loginCopy the code


Go to the package folder and use NPM publish to upload the NPM package
npm publishCopy the code

delete

NPM unpublish package name @version numberCopy the code
Or use
NPM unpublish package name@version number --forceCopy the code


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.


The public account replied to add group
Get in the group and share your technology with the big boys

Wechat public number: my web front-end self-help road

Reply to add group, exchange technology with the big guys