sample-number v1.0.0
Developing and Publishing NPM module
Directory and npm initialize mkdir directory-name cd directory-name npm init confirm/change entry point of the module
Use of some standard npm package ESLint babel
Semantic Versioning (SemVer) Package-version is defined in package.json Version-schema: MAJOR.MINOR.PATCH MAJOR: A number that we increment when we make incompatible API changes. MINOR: A number that we increment when we add features in a backwards-compatible manner. PATCH: A number that we increment when we make small bug fixes.
Test Define test-cases in ./test folder
Github Repo add following to link npm registry with github repo "repository": { "type": "git", "url": "https://github.com/anurag-slicepay/sample-number.git" }
Publishing the package Create an account in NPM registry, Signup here https://www.npmjs.com/signup "npm login" from command-line Test the login using: npm whoami npm publish
Good Practices for NPM Package: A useful README file Presence of github.com repo Use of SemVer test-cases in test folder with script "npm test" Use of code design patterns for some standard use-cases
5 years ago