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/

  • 相关阅读:
    jstl <c:url>标签
    4.12快速分类
    2.递归回溯求子集和数问题
    计算圆面积
    openal在vs2010中的配置
    结构体数组排序
    检测信号的有无
    matlab中mat文件简单存/取
    m文件转换c代码
    安装fftw到window(vs2010)及使用fftw库函数实现4096点fft变换计算
  • 原文地址:https://www.cnblogs.com/colin220/p/11527271.html
Copyright © 2011-2022 走看看