Node v14.2.0 (Current)

栏目: IT技术 · 发布时间: 4年前

内容简介:Additionally,Contributed by ConorDavenport -

assert.CallTracker is a new experimental API that allows to track and later verify the number of times a function was called. This works by creating a CallTracker object and using its calls method to create wrapper functions that will count each time they are called. Then the verify method can be used to assert that the expected number of calls happened:

const assert = require('assert');

const tracker = new assert.CallTracker();

function func() {}
// callsfunc() must be called exactly twice before tracker.verify().
const callsfunc = tracker.calls(func, 2);
callsfunc();
callsfunc();

function otherFunc() {}
// The second parameter defaults to `1`.
const callsotherFunc = tracker.calls(otherFunc);
callsotherFunc();

// Calls tracker.verify() and verifies if all tracker.calls() functions have
// been called the right number of times.
process.on('exit', () => {
  tracker.verify();
});

Additionally, tracker.report() will return an array which contains information about the errors, if there are any:

const assert = require('assert');

const tracker = new assert.CallTracker();

function func() {}
const callsfunc = tracker.calls(func);

console.log(tracker.report());
/*
[
  {
    message: 'Expected the func function to be executed 1 time(s) but was executed 0 time(s).',
    actual: 0,
    expected: 1,
    operator: 'func',
    stack: Error
        ...
  }
]
*/

Contributed by ConorDavenport - #31982 .

Console groupIndentation option

The Console constructor ( require('console').Console ) now supports different group indentations.

This is useful in case you want different grouping width than 2 spaces.

const { Console } = require('console');
const customConsole = new Console({
  stdout: process.stdout,
  stderr: process.stderr,
  groupIndentation: 10
});

customConsole.log('foo');
// 'foo'
customConsole.group();
customConsole.log('foo');
//           'foo'

Contributed by rickyes - #32964 .

Commits

Semver-minor commits

  • [ c87ed21fdf ] - (SEMVER-MINOR) assert : port common.mustCall() to assert (ConorDavenport) #31982
  • [ c49e3ea20c ] - (SEMVER-MINOR) console : support console constructor groupIndentation option (rickyes) #32964
  • [ bc9e413dae ] - (SEMVER-MINOR) worker : add stack size resource limit option (Anna Henningsen) #33085

Semver-patch commits

Documentation commits

Other commits

Windows 32-bit Installer: https://nodejs.org/dist/v14.2.0/node-v14.2.0-x86.msi

Windows 64-bit Installer: https://nodejs.org/dist/v14.2.0/node-v14.2.0-x64.msi

Windows 32-bit Binary: https://nodejs.org/dist/v14.2.0/win-x86/node.exe

Windows 64-bit Binary: https://nodejs.org/dist/v14.2.0/win-x64/node.exe

macOS 64-bit Installer: https://nodejs.org/dist/v14.2.0/node-v14.2.0.pkg

macOS 64-bit Binary: https://nodejs.org/dist/v14.2.0/node-v14.2.0-darwin-x64.tar.gz

Linux 64-bit Binary: https://nodejs.org/dist/v14.2.0/node-v14.2.0-linux-x64.tar.xz

Linux PPC LE 64-bit Binary: https://nodejs.org/dist/v14.2.0/node-v14.2.0-linux-ppc64le.tar.xz

Linux s390x 64-bit Binary: https://nodejs.org/dist/v14.2.0/node-v14.2.0-linux-s390x.tar.xz

AIX 64-bit Binary: https://nodejs.org/dist/v14.2.0/node-v14.2.0-aix-ppc64.tar.gz

ARMv7 32-bit Binary: https://nodejs.org/dist/v14.2.0/node-v14.2.0-linux-armv7l.tar.xz

ARMv8 64-bit Binary: https://nodejs.org/dist/v14.2.0/node-v14.2.0-linux-arm64.tar.xz

Source Code: https://nodejs.org/dist/v14.2.0/node-v14.2.0.tar.gz

Other release files: https://nodejs.org/dist/v14.2.0/

Documentation: https://nodejs.org/docs/v14.2.0/api/

SHASUMS

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

9b4461a1af6d6fc012db5c580ece88bb72aaf33307974fe7736e83ec4bca1788  node-v14.2.0-aix-ppc64.tar.gz
2447241aefe71dea8ba1552549e4df2e894d1ac12203630db3af63d4ae35c016  node-v14.2.0-darwin-x64.tar.gz
3caec491f8f8a46c0c88eeebfff6616c7fdbca9695b1e74cb70354507ac3bfd4  node-v14.2.0-darwin-x64.tar.xz
16158ba804b9d4877624477b706a82796c5895a1f130eada3546dd6070f76b73  node-v14.2.0-headers.tar.gz
f6ca257360e99cb8158ef9cd432f7620aba4f8635dcf9fe0a9c5da1747fe2614  node-v14.2.0-headers.tar.xz
2fd9bf7b3fc8a0e72ec27f1d274b8eedd1c81e8af3f82739c787ddc288037a4c  node-v14.2.0-linux-arm64.tar.gz
4587d2c52cd348094bd46ee4ee8cdfeb549462ead9b4aadc9cfc3c5fc3ba7215  node-v14.2.0-linux-arm64.tar.xz
5d898328e8985cd2714a56800766e27d5dbecf3c7ba953e1df9d155328b3ee76  node-v14.2.0-linux-armv7l.tar.gz
530df44de700ced3ee09f77c84a9ec75f4b6e2842ae970a71f6082874f84e966  node-v14.2.0-linux-armv7l.tar.xz
45c6a4edfd3179e9f53fc76faa0bd3c255022e6491d9961d9ff0caca9947bd98  node-v14.2.0-linux-ppc64le.tar.gz
426aad83e3399c9bb9c5972781eba2536cc2244013ee293bbecd7f15830f76b6  node-v14.2.0-linux-ppc64le.tar.xz
47843ea36678a898679b934347f2ab4471b227cc088f57a53afd502d37009cf6  node-v14.2.0-linux-s390x.tar.gz
936acec34a3225c27cea055cd55d775f9b0bfa4c87f8f184c93932058908094d  node-v14.2.0-linux-s390x.tar.xz
3307d8b95014e78b43f85242a03fe3b28edfb90cc15e1d26393dcbbc51d05c8e  node-v14.2.0-linux-x64.tar.gz
468cbd92271da8c0cacaa3fa432a73a332e398bade8ad7359a94aa8ab3cc3cca  node-v14.2.0-linux-x64.tar.xz
ade90531fb98d5ba5fb58df42e0e1aebd8c11ae1e67c3c720135887a3431adea  node-v14.2.0.pkg
8c9aa909567589e97a22b2df1cf6a8d61e0a546b4c784703e6722f13da259493  node-v14.2.0.tar.gz
8efdcc3ae381909cc9c4bd08644481a594e08b5a6a7d05814e1c32b1279e16cf  node-v14.2.0.tar.xz
51cc7f4a712cb969a4153ca5c2ebfe8c052987fa4e025d3d98b1c7b1240f06f2  node-v14.2.0-win-x64.7z
99085f45a894e257123d7c729113cc00ed1413df432dbdce5fe53867e7c53b11  node-v14.2.0-win-x64.zip
9d616effae140f8f53b5659f07bb0dd5bc3af00b06dfd649401403416ea0e5b3  node-v14.2.0-win-x86.7z
ec5a318016e91a6bb38adb95f9890a483f70e522f4bf97229fe85eb19cd0dd2e  node-v14.2.0-win-x86.zip
f855ba61fad5ba16756b47038a1e4c5cb50685dbe2f5a1876c05fbc7300e6ea9  node-v14.2.0-x64.msi
82a93917b3025575ce5436c5cba7aead7876a89289f3ed189444a065d8b57324  node-v14.2.0-x86.msi
fc3481a669f071e6a1977ff348ae072f324610dc0a92d051d772b594c6988638  win-x64/node.exe
0084f3d15cc6ca50db917c684941a85f8c4c901f726e1c74bbe57431a1479211  win-x64/node.lib
6ef164e08b2edd08240bb3a465726fb801e766166293355153c641a55d815768  win-x64/node_pdb.7z
8a49eed2e4a93f290d874009a1d96c377495c931b159895bdcadc7fd4554b411  win-x64/node_pdb.zip
02900d6f56eb7820df1c75400f7bc839df50fe70f326dfa2621055c13bd4a725  win-x86/node.exe
b4287d2e5632595de8078815d3b7cd63396c8674146896e17c736c9fead23eae  win-x86/node.lib
8a9a50dc90a1ec43e0e9ecc890a52441c8395fd14a264808ec71e7e6c848fed3  win-x86/node_pdb.7z
9b25070a4c10b289fb6cab40a25078ad198d6fbf13e483768387fbdc12d98a51  win-x86/node_pdb.zip
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEj8yhP+8dDC6RAI4Jdw96mlrhVgAFAl6xr94ACgkQdw96mlrh
VgAGIA/7BfKeeB0R7n03c+NsoL5XoPzdGVA/ZGJbLrWB0gawIIcYeFv4+AHiSSLy
wmECt/whwgsGUBdtfjXa7uBhD0Cq56sybQfQrIPFIt5xJO5HH/hFaRe0qqHuL0tb
GWzjaNGZawgfS5DXka1fJ1AnqBWMkeaJKQB8owy5Jrzmphd37Pee6Wn+Ik5xSx3h
swNTNn1JyagtorfHdHsaAA2kectcyeUJQ9TOzEdxhbrGBehtGyPYGI1gq+seQsTi
f2IvftJNH8I4b+gwBI8hLE6kuZ6spC+VtWSV8K1LTboDgkroPcdQ6oOhiQW10WV6
XQzwDtFvok03O7yWtaA5mvb1fVgffXCXlytCET3ibiaEtyMblnVnOul7x98MHf6E
p1S2OLuu5Xl63yTXTwmvypppTVRMG+kNCJOWMwf+wz+c2nyfDKmXpaDFsACBKCQm
92c0vwoTZKLK2xB/cNrnHm2QmfAqGIiDaTURO6XNKtHTDEwlHfAvM9DzzVnA9WDL
q9bGAiAllUExnA4vuTMSsFHrUSnEfoF3+4xpeyZqy3+QWNbnwn5q8XmJWE/jWtLb
7lmG0DL39kY6IyKupTWjoBtZVLFLGTT/1Xt9KVKbQRhCCRp26aRchVzqKe/neYDq
roC9JLqdcLeE+UEXCGBR+WL8FrAmKZmeRN0mGJwVdTJJZXOOkKE=
=uF86
-----END PGP SIGNATURE-----

以上所述就是小编给大家介绍的《Node v14.2.0 (Current)》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

认知与设计

认知与设计

Jeff Johnson / 张一宁、王军锋 / 人民邮电出版社 / 2014-8-1 / CNY 69.00

本书语言清晰明了,将设计准则与其核心的认知学和感知科学高度统一起来,使得设计准则更容易地在具体环境中得到应用。涵盖了交互计算机系统设计的方方面面,为交互系统设计提供了支持工程方法。不仅如此,这也是一本人类行为原理的入门书。一起来看看 《认知与设计》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具