node.js - package overview

 

Overview

  • The commonJS package specification allows us to combine a set of related modules together to form a complete set of tools
  • Package structure: various files used to organize packages
  1. It is actually a compressed file. After decompression, the directory will be restored. A directory that meets the specification should contain the following files
    • Required for package.json description file  
    • bin executable binary file
    • lib js code
    • doc document
    • test unit test
  • Package description file: Describe the relevant information of the package for external reading and analysis

package.json introduction

  • The role of each attribute in the standard package.json and package.json.
  • "name":包名。
  • "description": Introduction to the package.
  • "author": package author.
  • "version": Version number.
  • "repository": Source code hosting address.
  • "maintainers": A list of package maintainers, generally composed of three attributes: name, email, and web.
  • "contributors": List of contributors.
  • "dependencies": The list of dependent packages needed when the current package is used.
  • devDependencies: The list of dependencies required for the current package development.
  • keywords: An array of keywords.
  • main: The module import entry.
  • scripts: script description object. Mainly used by package managers to install, compile, test and uninstall packages.

Guess you like

Origin blog.csdn.net/adminBfl/article/details/107047930