normalize-node-version

Normalize and validate Node.js versions
授权协议 Apache-2.0 License
开发语言 SHELL
所属分类 应用工具、 终端/远程登录
软件类型 开源软件
地区 不详
投 递 者 蔺弘
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Build

Normalize and validate Node.js versions.

Takes any version range as inputs such as 8, 8.5.0 or >=8 and returns a"major.minor.patch" string. Throws if the Node.js version does not exist.

Example

import normalizeNodeVersion from 'normalize-node-version'

await normalizeNodeVersion('8') // '8.17.0'
await normalizeNodeVersion('8.5.0') // '8.5.0'
await normalizeNodeVersion('v8.5.0') // '8.5.0'
await normalizeNodeVersion('<7') // '6.17.1'
await normalizeNodeVersion('8.5.2') // Error: Invalid Node version
await normalizeNodeVersion('not_a_version') // Error: Invalid Node version

// All available options
await normalizeNodeVersion('8', {
  // Use a mirror for Node.js binaries
  mirror: 'https://npm.taobao.org/mirrors/node',
  // Do not cache the list of available Node.js versions
  fetch: true,
})

Install

npm install normalize-node-version

This package is an ES module and must be loaded usingan import or import() statement,not require().

Usage

normalizeNodeVersion(versionRange, options?)

versionRange: string
options: object?
Returns: Promise<string>

options

mirror

Type: string
Default: https://nodejs.org/dist

Base URL to fetch the list of available Node.js versions. Can be customized (forexample https://npm.taobao.org/mirrors/node).

The following environment variables can also be used: NODE_MIRROR,NVM_NODEJS_ORG_MIRROR, N_NODE_MIRROR or NODIST_NODE_MIRROR.

fetch

Type: boolean
Default: undefined

The list of available Node.js versions is cached for one hour by default. If thefetch option is:

  • true: the cache will not be used
  • false: the cache will be used even if it's older than one hour

See also

Support

For any question, don't hesitate to submit an issue on GitHub.

Everyone is welcome regardless of personal background. We enforce aCode of conduct in order to promote a positive andinclusive environment.

Contributing

This project was made with ❤️ . The simplest way to give back is by starring andsharing it online.

If the documentation is unclear or has a typo, please click on the page's Editbutton (pencil icon) and suggest a correction.

If you would like to help us fix a bug or add a new feature, please check ourguidelines. Pull requests are welcome!

Thanks go to our wonderful contributors:


ehmicky

�� �� �� ��

Adrien Becchis

�� ⚠️ ��
  • 方法说明: 输出规范格式的path字符串。 语法: path.normalize(p) 由于该方法属于path模块,使用前需要引入path模块(var path= require(“path”) ) 例子: path.normalize('/foo/bar//baz/asdf/quux/..') // returns '/foo/bar/baz/asdf' 源码: // windows versi

  • XML DOM - Node 对象   节点对象代表文档树中的一个节点。 Node 对象 Node 对象是整个 DOM 的主要数据类型。 节点对象代表文档树中的一个单独的节点。 节点可以是元素节点、属性节点、文本节点,或者也可以是“节点类型”那一节中所介绍的任何一种节点。 请注意,虽然所有的对象均能继承用于处理父节点和子节点的属性和方法,但是并不是所有的对象都拥有父节点或子节点。例如,文本节点不能

  • 关于node.js Node.js 是服务器端的 JavaScript 运行环境,它具有无阻塞(non-blocking)和事件驱动(event-driven)等的特色,Node.js 采用V8引擎,同样,Node.js实现了类似 Apache 和 nginx 的web服务,让你可以通过它来搭建基于 JavaScript的Web App。 Node.js采用C++语言编写而成,是一个跨平台的Jav

  •   Java操作xml   2007-12-11 23:07:06|  分类: Java |举报 |字号 订阅     Java的API中提供了许多能有效地操作xml的类。这些类遵循了通用的国际标准。若干标准中使用最多是DOM,即Document Object Model,文档对象模型。它的基本思路是,把xml文件对应到内存中的一个xml树。通过对父、子、兄弟等的关系的访问可很方便地在各个结点间游

  • 问题背景: 修改package.json中的version信息为:6.4.1.0。 npm run dev报错信息如下: F:\>npm run dev > ui-admin@6.4.1.0 dev > vue-cli-service serve --mode dev F:\node_modules\normalize-package-data\lib\fixer.js:191

 相关资料
  • 本文向大家介绍Reset CSS和Normalize CSS的区别是什么?相关面试题,主要包含被问及Reset CSS和Normalize CSS的区别是什么?时的应答技巧和注意事项,需要的朋友参考一下 Reset:将所有浏览器的默认样式都统一化,注重的是跨浏览器统一样式,用户还要自行添加一些默认样式。 Normalize:会根据各个浏览器的不同保留有用的浏览器特色样式,修复浏览器的一些BUG,更

  • Node是kubernetes集群的工作节点,可以是物理机也可以是虚拟机。 Node的状态 Node包括如下状态信息: Address HostName:可以被kubelet中的--hostname-override参数替代。 ExternalIP:可以被集群外部路由到的IP地址。 InternalIP:集群内部使用的IP,集群外部无法访问。 Condition OutOfDisk:磁盘空间不足时

  • node 负责 peer node 子命令。

  • 这用于确定进程需要运行的节点的值。 由于分布式编程用于在不同节点上运行函数,因此在希望在不同机器上运行程序时,此功能非常有用。 语法 (Syntax) node() 参数 (Parameters) None 返回值 (Return Value) 这将返回本地节点的名称。 如果节点未分发,则返回nonode@nohost 。 例如 (For example) -module(helloworld)

  • The Po.et Node The Po.et Node allows you to timestamp documents in a decentralized manner. It's built on top of the Bitcoin blockchain and IPFS. Index The Po.et Node Index How to Run the Po.et Node De

  • Node-Lua是一款基于Lua实现的脚本和服务器引擎,它支持构建海量Lua服务(Context_Lua)并以多线程方式运行在多核服务器上,采用了任务多路复用的设计方案,有效利用了多核优势。node-lua致力于构建一个快速、简单易用的Lua脚本和服务器开发和运行环境。该引擎参考了Node-Js和Skynet的设计思想,并对其进行了整合和优化。 该引擎当前版本实现了以下特性: 引擎核心层同时支持同