I'm in the process of creating a few NPM packages and I'd like to know what are the best practices to write the user documentation for them (as there's very little information, and searching for anything related with npm package documentation
inevitably yields to the npm docs themselves).
When you publish a package, where does the registry get the front page document from?
I guess that having a nice README.md
file is the first step for anybody that browses the github repo, but I'd like to provide a convenient way to read the compiled JsDoc too.
–npm install --save or -S: When the following command is used with npm install this will save all your installed core packages into the dependency section in the package. json file. Core dependencies are those packages without which your application will not give the desired results.
Publishing a public organization scoped package To publish an organization scoped package as public, use npm publish --access public . On the command line, navigate to the package directory. Run npm publish --access public .
Note: Before you can publish private user-scoped npm packages, you must sign up for a paid npm user account. Additionally, to publish private organization-scoped packages, you must create an npm user account, then create a paid npm organization.
The npm package page for a package gets the data in the table at the top from either package.json
fields in your package (name, description, dependencies, etc) or from the npm databases themselves (download graph, last published, stars, dependents, etc). The stuff below that is just the README.md converted from markdown to HTML.
So a good README.md
is all most packages do. If you want to build your jsdoc into HTML and publish that somewhere (perhaps just the git repo itself), I would suggest just linking to that prominently in the README and calling it good.
I found an interesting package to make the README.md out from jsdoc:
https://www.npmjs.org/package/jsdoc-to-markdown
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With