
Npm uses a versioning system called Semantic Versioning (SemVer). This is the version we should use for the initial version of a package published to npm. Note how we are using the version 1.0.0 for this package. The created package.json file contains these details. (the author fill may not be asked if you are already logged in and with the author set up in the initial documentation as we did above). "description": "Capitalizes the first letter of every word in a sentence",

Save it as a dependency in the package.json file.ĭescription: Capitalizes the first letter of every word in a sentenceĪbout to write to /Users/zojcruzm/Projects/title-case-converter/package.json: Use `npm install ` afterwards to install a package and

See `npm help init` for definitive documentation on these fields It only covers the most common items, and tries to guess sensible defaults. This utility will walk you through creating a package.json file. These details will be added to the package.json file of the project when it’s created. Save your name, email, and website (if any) to npm.
#NPM INSTALL FROM GITHUB WRONG PACKAGE NAME LICENSE#
Choose an appropriate license like the MIT license as well. Make sure to initialize the repository with a README. Create a GitHub repositoryĬreate a new repository named “title-case-converter” in GitHub. The name of the package we are going to create is “title-case-converter”. However, if the package is scoped, or private, the package name does not have to be unique and the name takes the format of You can find out more about scoped packages here Your package name should be unique if you are publishing it as an unscoped (public) package. When choosing a name for the npm package, you have to check whether the name is available on the official npm website In this tutorial, we are creating a simple library that converts a sentence to title case (in which the first letter of every word is capitalized). If you have all of the above set up, let’s get to publishing the library.

If you are a Node.js developer, using npm packages won’t be a new concept to you. Publish Your First Node Library Using NPM Updated on Jul 21, 2020
