zoukankan      html  css  js  c++  java
  • npm:基础

    npm consists of three distinct components

    • the website
    • the Command Line Interface (CLI)
    • the registry

    Use the website to discover packages, set up profiles, and manage other aspects of your npm experience.

    The CLI runs from a terminal, and is how most developers interact with npm.

    The registry is a large public database of JavaScript software and the meta-information surrounding it.

    在 npm registry 中包含了各种各样的 packages 和 Node moudules。

    npm registry 中的最小元素是 package 和 module。

    什么是 package ?

    A package is a file or directory that is described by a package.json file. A package must contain a package.json file in order to be published to the npm registry.

    那么 package 的格式是什么样的呢?

    • a) A folder containing a program described by a package.json file.
    • b) A gzipped tarball containing (a).
    • c) A URL that resolves to (b).
    • d) A <name>@<version> that is published on the registry with (c).
    • e) A <name>@<tag> that points to (d).
    • f) A <name> that has a latest tag satisfying (e).
    • g) A git url that, when cloned, results in (a).

    什么是 module ?

    A module is any file or directory in the node_modules directory that can be loaded by the Node.js require() function.

    为了可以被 Node.js 中 require() 函数引用,module 必须是如下格式:

    • A folder with a package.json file containing a "main" field.
    • A folder with an index.js file in it.
    • A JavaScript file.

    一般来说,npm 是一款用于管理包的工具。

    参考:

    https://docs.npmjs.com/about-npm/

  • 相关阅读:
    PHP操作Memcache基本函数
    sublime text 设置
    获取客户端IP地址经纬度所在城市
    php 中文转拼音首字母问题
    php分类
    php +mysql 添加 删除 修改 insert into delete update
    php+mysql 内联接 和 子查询
    mysql count max min 语句用法
    mysql 查询语句
    非常不错的MySQL优化的8条经验
  • 原文地址:https://www.cnblogs.com/colin220/p/11527271.html
Copyright © 2011-2022 走看看