util: add MIME utilities by bmeck · Pull Request #21128 · nodejs/node

@nodejs-github-bot nodejs-github-bot added c++

Issues and PRs that require attention from people who are familiar with C++.

lib / src

Issues and PRs related to general changes in the lib or src directory.

labels

Jun 4, 2018

@bmeck bmeck added the module

Issues and PRs related to the module subsystem.

label

Jun 4, 2018

addaleax

addaleax

@Trott Trott added the blocked

PRs that are blocked by other issues or PRs.

label

Jun 5, 2018

@Trott Trott mentioned this pull request

Jun 5, 2018

GeoffreyBooth

jasnell

jasnell

jasnell

@aduh95

RafaelGSS pushed a commit that referenced this pull request

Nov 1, 2022
Co-authored-by: Rich Trott <rtrott@gmail.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #21128
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

RafaelGSS added a commit that referenced this pull request

Nov 1, 2022
Notable changes:

* deps:
  * update ICU to 72.1 (Michaël Zasso) [#45068](#45068)
* doc:
  * add lukekarrys to collaborators (Luke Karrys) [#45180](#45180)
  * add anonrig to collaborators (Yagiz Nizipli) [#45002](#45002)
* fs:
  * (SEMVER-MINOR) fs: add recursive watch to linux (Yagiz Nizipli) [#45098](#45098)
* util
  * (SEMVER-MINOR) add MIME utilities (Bradley Farias) [#21128](#21128)

PR-URL: TBD

RafaelGSS added a commit that referenced this pull request

Nov 1, 2022
Notable changes:

* deps:
  * update ICU to 72.1 (Michaël Zasso) [#45068](#45068)
* doc:
  * add lukekarrys to collaborators (Luke Karrys) [#45180](#45180)
  * add anonrig to collaborators (Yagiz Nizipli) [#45002](#45002)
* fs:
  * (SEMVER-MINOR) fs: add recursive watch to linux (Yagiz Nizipli) [#45098](#45098)
* util
  * (SEMVER-MINOR) add MIME utilities (Bradley Farias) [#21128](#21128)

PR-URL: #45269

RafaelGSS added a commit that referenced this pull request

Nov 1, 2022
Notable changes:

* deps:
  * update ICU to 72.1 (Michaël Zasso) [#45068](#45068)
* doc:
  * add lukekarrys to collaborators (Luke Karrys) [#45180](#45180)
  * add anonrig to collaborators (Yagiz Nizipli) [#45002](#45002)
* fs:
  * (SEMVER-MINOR) fs: add recursive watch to linux (Yagiz Nizipli) [#45098](#45098)
* util
  * (SEMVER-MINOR) add MIME utilities (Bradley Farias) [#21128](#21128)

PR-URL: #45269

RafaelGSS added a commit that referenced this pull request

Nov 1, 2022
Notable changes:

* deps:
  * update ICU to 72.1 (Michaël Zasso) [#45068](#45068)
* doc:
  * add lukekarrys to collaborators (Luke Karrys) [#45180](#45180)
  * add anonrig to collaborators (Yagiz Nizipli) [#45002](#45002)
* fs:
  * (SEMVER-MINOR) fs: add recursive watch to linux (Yagiz Nizipli) [#45098](#45098)
* util
  * (SEMVER-MINOR) add MIME utilities (Bradley Farias) [#21128](#21128)

PR-URL: #45269

RafaelGSS pushed a commit that referenced this pull request

Nov 10, 2022
Co-authored-by: Rich Trott <rtrott@gmail.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #21128
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

RafaelGSS added a commit that referenced this pull request

Nov 10, 2022
Notable changes:

* deps:
  * update ICU to 72.1 (Michaël Zasso) [#45068](#45068)
* doc:
  * add lukekarrys to collaborators (Luke Karrys) [#45180](#45180)
  * add anonrig to collaborators (Yagiz Nizipli) [#45002](#45002)
* fs:
  * (SEMVER-MINOR) fs: add recursive watch to linux (Yagiz Nizipli) [#45098](#45098)
* util
  * (SEMVER-MINOR) add MIME utilities (Bradley Farias) [#21128](#21128)

PR-URL: #45269

RafaelGSS added a commit that referenced this pull request

Nov 10, 2022
Notable changes:

* deps:
  * update ICU to 72.1 (Michaël Zasso) [#45068](#45068)
* doc:
  * add lukekarrys to collaborators (Luke Karrys) [#45180](#45180)
  * add anonrig to collaborators (Yagiz Nizipli) [#45002](#45002)
* fs:
  * (SEMVER-MINOR) fs: add recursive watch to linux (Yagiz Nizipli) [#45098](#45098)
* lib:
  * drop fetch experimental warning (Matteo Collina) [#45287](#45287)
* util
  * (SEMVER-MINOR) add MIME utilities (Bradley Farias) [#21128](#21128)
  * improve textdecoder decode performance (Yagiz Nizipli) [#45294](#45294)

PR-URL: #45269

RafaelGSS added a commit that referenced this pull request

Nov 10, 2022
Notable changes:

* deps:
  * update ICU to 72.1 (Michaël Zasso) [#45068](#45068)
* doc:
  * add lukekarrys to collaborators (Luke Karrys) [#45180](#45180)
  * add anonrig to collaborators (Yagiz Nizipli) [#45002](#45002)
* fs:
  * (SEMVER-MINOR) fs: add recursive watch to linux (Yagiz Nizipli) [#45098](#45098)
* lib:
  * drop fetch experimental warning (Matteo Collina) [#45287](#45287)
* util
  * (SEMVER-MINOR) add MIME utilities (Bradley Farias) [#21128](#21128)
  * improve textdecoder decode performance (Yagiz Nizipli) [#45294](#45294)

PR-URL: #45269

RafaelGSS added a commit that referenced this pull request

Nov 11, 2022
Notable changes:

* deps:
  * update ICU to 72.1 (Michaël Zasso) [#45068](#45068)
* doc:
  * add lukekarrys to collaborators (Luke Karrys) [#45180](#45180)
  * add anonrig to collaborators (Yagiz Nizipli) [#45002](#45002)
* fs:
  * (SEMVER-MINOR) fs: add recursive watch to linux (Yagiz Nizipli) [#45098](#45098)
* lib:
  * drop fetch experimental warning (Matteo Collina) [#45287](#45287)
* util
  * (SEMVER-MINOR) add MIME utilities (Bradley Farias) [#21128](#21128)
  * improve textdecoder decode performance (Yagiz Nizipli) [#45294](#45294)

PR-URL: #45269

RafaelGSS added a commit that referenced this pull request

Nov 11, 2022
Notable changes:

* deps:
  * update ICU to 72.1 (Michaël Zasso) [#45068](#45068)
* doc:
  * add lukekarrys to collaborators (Luke Karrys) [#45180](#45180)
  * add anonrig to collaborators (Yagiz Nizipli) [#45002](#45002)
* fs:
  * (SEMVER-MINOR) fs: add recursive watch to linux (Yagiz Nizipli) [#45098](#45098)
* lib:
  * drop fetch experimental warning (Matteo Collina) [#45287](#45287)
* util
  * (SEMVER-MINOR) add MIME utilities (Bradley Farias) [#21128](#21128)
  * improve textdecoder decode performance (Yagiz Nizipli) [#45294](#45294)

PR-URL: #45269

RafaelGSS added a commit that referenced this pull request

Nov 11, 2022
Notable changes:

* deps:
  * update ICU to 72.1 (Michaël Zasso) [#45068](#45068)
* doc:
  * add lukekarrys to collaborators (Luke Karrys) [#45180](#45180)
  * add anonrig to collaborators (Yagiz Nizipli) [#45002](#45002)
* fs:
  * (SEMVER-MINOR) fs: add recursive watch to linux (Yagiz Nizipli) [#45098](#45098)
* lib:
  * drop fetch experimental warning (Matteo Collina) [#45287](#45287)
* test_runner:
  * support function mocking (Colin Ihrig) [#45326](#45326)
* util
  * (SEMVER-MINOR) add MIME utilities (Bradley Farias) [#21128](#21128)
  * improve textdecoder decode performance (Yagiz Nizipli) [#45294](#45294)

PR-URL: #45269

RafaelGSS added a commit that referenced this pull request

Nov 14, 2022
Notable changes:

* deps:
  * update ICU to 72.1 (Michaël Zasso) [#45068](#45068)
* doc:
  * add lukekarrys to collaborators (Luke Karrys) [#45180](#45180)
  * add anonrig to collaborators (Yagiz Nizipli) [#45002](#45002)
* fs:
  * (SEMVER-MINOR) fs: add recursive watch to linux (Yagiz Nizipli) [#45098](#45098)
* lib:
  * drop fetch experimental warning (Matteo Collina) [#45287](#45287)
* test_runner:
  * support function mocking (Colin Ihrig) [#45326](#45326)
* util
  * (SEMVER-MINOR) add MIME utilities (Bradley Farias) [#21128](#21128)
  * improve textdecoder decode performance (Yagiz Nizipli) [#45294](#45294)

PR-URL: #45269

danielleadams pushed a commit that referenced this pull request

Dec 30, 2022
Co-authored-by: Rich Trott <rtrott@gmail.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #21128
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

danielleadams added a commit that referenced this pull request

Dec 30, 2022
Notable changes:

Add support for externally shared js builtins:

By default Node.js is built so that all dependencies are bundled into the
Node.js binary itself. Some Node.js distributions prefer to manage dependencies
externally. There are existing build options that allow dependencies with
native code to be externalized. This commit adds additional options so that
dependencies with JavaScript code (including WASM) can also be externalized.
This addition does not affect binaries shipped by the Node.js project but
will allow other distributions to externalize additional dependencies when
needed.

Contributed by Michael Dawson in #44376

fs.watch recursive support on Linux:

`fs.watch` supports recursive watch using the `recursive: true` option.

```js
const watcher = fs.watch(testDirectory, { recursive: true });
watcher.on('change', function(event, filename) {
});
```

Contributed by Yagiz Nizipli in #45098

Support function mocking on Node.js test runner:

The `node:test` module supports mocking during testing via a top-level `mock`
object.

```js
test('spies on an object method', (t) => {
  const number = {
    value: 5,
    add(a) {
      return this.value + a;
    },
  };
  t.mock.method(number, 'add');

  assert.strictEqual(number.add(3), 8);
  assert.strictEqual(number.add.mock.calls.length, 1);
});
```

Contributed by Colin Ihrig in #45326

Other notable changes:

buffer:
  * (SEMVER-MINOR) introduce File (Khafra) #45139
build:
  * disable v8 snapshot compression by default (Joyee Cheung) #45716
crypto:
  * update root certificates (Luigi Pinca) #45490
deps:
  * update ICU to 72.1 (Michaël Zasso) #45068
doc:
  * add doc-only deprecation for headers/trailers setters (Rich Trott) #45697
  * add Rafael to the tsc (Michael Dawson) #45691
  * deprecate use of invalid ports in `url.parse` (Antoine du Hamel) #45576
  * add lukekarrys to collaborators (Luke Karrys) #45180
  * add anonrig to collaborators (Yagiz Nizipli) #45002
  * deprecate url.parse() (Rich Trott) #44919
lib:
  * drop fetch experimental warning (Matteo Collina) #45287
net:
  * (SEMVER-MINOR) add autoSelectFamily and autoSelectFamilyAttemptTimeout options (Paolo Insogna) #44731
* src:
  * (SEMVER-MINOR) add uvwasi version (Jithil P Ponnan) #45639
  * (SEMVER-MINOR) add initial shadow realm support (Chengzhong Wu) #42869
test_runner:
  * (SEMVER-MINOR) add t.after() hook (Colin Ihrig) #45792
  * (SEMVER-MINOR) don't use a symbol for runHook() (Colin Ihrig) #45792
tls:
  * (SEMVER-MINOR) add "ca" property to certificate object (Ben Noordhuis) #44935
  * remove trustcor root ca certificates (Ben Noordhuis) #45776
tools:
  * update certdata.txt (Luigi Pinca) #45490
util:
  * add fast path for utf8 encoding (Yagiz Nizipli) #45412
  * improve textdecoder decode performance (Yagiz Nizipli) #45294
  * (SEMVER-MINOR) add MIME utilities (#21128) (Bradley Farias) #21128

PR-URL: TBD

danielleadams added a commit that referenced this pull request

Dec 30, 2022
Notable changes:

Add support for externally shared js builtins:

By default Node.js is built so that all dependencies are bundled into the
Node.js binary itself. Some Node.js distributions prefer to manage dependencies
externally. There are existing build options that allow dependencies with
native code to be externalized. This commit adds additional options so that
dependencies with JavaScript code (including WASM) can also be externalized.
This addition does not affect binaries shipped by the Node.js project but
will allow other distributions to externalize additional dependencies when
needed.

Contributed by Michael Dawson in #44376

fs.watch recursive support on Linux:

`fs.watch` supports recursive watch using the `recursive: true` option.

```js
const watcher = fs.watch(testDirectory, { recursive: true });
watcher.on('change', function(event, filename) {
});
```

Contributed by Yagiz Nizipli in #45098

Support function mocking on Node.js test runner:

The `node:test` module supports mocking during testing via a top-level `mock`
object.

```js
test('spies on an object method', (t) => {
  const number = {
    value: 5,
    add(a) {
      return this.value + a;
    },
  };
  t.mock.method(number, 'add');

  assert.strictEqual(number.add(3), 8);
  assert.strictEqual(number.add.mock.calls.length, 1);
});
```

Contributed by Colin Ihrig in #45326

Other notable changes:

buffer:
  * (SEMVER-MINOR) introduce File (Khafra) #45139
build:
  * disable v8 snapshot compression by default (Joyee Cheung) #45716
crypto:
  * update root certificates (Luigi Pinca) #45490
deps:
  * update ICU to 72.1 (Michaël Zasso) #45068
doc:
  * add doc-only deprecation for headers/trailers setters (Rich Trott) #45697
  * add Rafael to the tsc (Michael Dawson) #45691
  * deprecate use of invalid ports in `url.parse` (Antoine du Hamel) #45576
  * add lukekarrys to collaborators (Luke Karrys) #45180
  * add anonrig to collaborators (Yagiz Nizipli) #45002
  * deprecate url.parse() (Rich Trott) #44919
lib:
  * drop fetch experimental warning (Matteo Collina) #45287
net:
  * (SEMVER-MINOR) add autoSelectFamily and autoSelectFamilyAttemptTimeout options (Paolo Insogna) #44731
* src:
  * (SEMVER-MINOR) add uvwasi version (Jithil P Ponnan) #45639
  * (SEMVER-MINOR) add initial shadow realm support (Chengzhong Wu) #42869
test_runner:
  * (SEMVER-MINOR) add t.after() hook (Colin Ihrig) #45792
  * (SEMVER-MINOR) don't use a symbol for runHook() (Colin Ihrig) #45792
tls:
  * (SEMVER-MINOR) add "ca" property to certificate object (Ben Noordhuis) #44935
  * remove trustcor root ca certificates (Ben Noordhuis) #45776
tools:
  * update certdata.txt (Luigi Pinca) #45490
util:
  * add fast path for utf8 encoding (Yagiz Nizipli) #45412
  * improve textdecoder decode performance (Yagiz Nizipli) #45294
  * (SEMVER-MINOR) add MIME utilities (#21128) (Bradley Farias) #21128

PR-URL: #46025

danielleadams pushed a commit that referenced this pull request

Dec 30, 2022
Co-authored-by: Rich Trott <rtrott@gmail.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #21128
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: James M Snell <jasnell@gmail.com>