Register your account First
NPM website Address: https://www.npmjs.com/
NPM website Registration Address: Https://www.npmjs.com/signup
Registration completed, back to our computer. Windows direct cmd to the command line:
Enter the following command and prompt for the username, password, and mailbox, which are all filled out when registering.
Before release, prepare first:
Manually create a folder named Lib, manually create the Index.js, Package.sjon, and typing.d.ts documents, and then start the next step after the creation is complete, adding the appropriate documentation to the inside.
Lib to add your component or the file you want to publish.
For example – with maps:
Or
The next step is the Index.js document.
is to add your module in, with the map: Export * from './lib/datatable/datatable.module ';
Next, configure the Package.json document:
{
' Name ': ' ng-itoo-datatable ',//NOTE: Name yourself
"Version": "1.1.4",//version number
"description": "Add the ability to sort tables by column",
"Main": "Index.js",//Your index document
"Typings": "Typings.d.ts",//Your ytpings.d.ts document
"Scripts": {
"Test": "Echo \" Error:no test specified\ "&& exit 1"
},
"keywords": [
"Itoo",
"DataTable"
],
"Author": "Ledary",//Founder's name
"License": "ISC",//
"_from": "ng-itoo-datatable@1.1.2",
"_resolved": "Http://registry.npm.taobao.org/ng-itoo-datatable/download/ng-itoo-datatable-1.1.2.tgz"
}
Next Configure your Typings.d.ts document: Export {Datatablemodule} from './lib/datatable/datatable.module ';
The above work is ready to be completed and then launched:
Login: NPM Login
After landing: Then press SHIFT + right-click on the item you want to publish: – Select "Open PowerShell window (S)" Here
Entering in Windows PowerShell: NPM Init
The creation is completed and the publication is started. NPM Publish project Name
That's this OK inside. (yes) y
Just enter a Y-carriage directly, and then complete the following steps.
This is successful, warm tip: The success of the release does not mean that it is okay, the first test to see if you can achieve the desired results, reached, is the release of success. ‘
The whole process: