profile
viewpoint

aduh95/ecc-jsbn 16

ECC package based on JSBN

aduh95/preact-fontawesome 1

Font Awesome 5 React component

aduh95/aduh95.github.io 0

Personal curriculum vitae

aduh95/Apache-Virtual-Hosts-Creator 0

Apache Virtual Hosts Creator - This script will setup a Apache Virtual Hosts for you using bash

aduh95/async-jsx 0

JSX syntax for vanilla JS, and async

aduh95/autoprefixer 0

Parse CSS and add vendor prefixes to rules by Can I Use

aduh95/balloon.css 0

Simple tooltips made of pure CSS

aduh95/bootstrap 0

The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.

aduh95/create-react-app 0

Create React apps with no build configuration.

aduh95/CSRF-Protector-PHP 0

CSRF Protector library: standalone library for CSRF mitigation

push eventaduh95/toml.wasm

Antoine du HAMEL

commit sha 22663032037902efdbc2293669a2824398645458

Fix ReferenceError

view details

push time in 2 hours

issue commentdenoland/deno

Compile-to-javaScript (still) is turn-away

It's about why not AssemblyScript for this project?

Nothing's stopping you from using AssemblyScript with deno, as it supports WebAssembly already. Now if you are asking for built-in support for AssemblyScript, that's something else. If you feel strongly about this, I encourage you to work on an implement and open a PR, but I have to warn you it may not be a popular-enough feature to have it land in Deno core.

The AssemblyScript FAQ goes in details on the reasons why you shouldn't expect JavaScript to be gone anytime soon and how WASM is not always better.

jayarjo

comment created time in 5 hours

issue commentdenoland/deno

Compile-to-javaScript (still) is turn-away

And make TypeScript compile to WebAssembly.

I think you want to check out AssemblyScript.

Deno is a JavaScript runtime, I don't know if it's "oriented on future", but this is the way it is. If you don't like it, then don't use it; I personally love it.

jayarjo

comment created time in 7 hours

push eventaduh95/node

Antoine du HAMEL

commit sha 2e5f7809d1d56fe12d004e576434544e4d934a39

worker_threads: add support for data URLs

view details

push time in 7 hours

pull request commentnodejs/node

Add type option to Worker constructor

I have removed the loader selection for this PR to unblock it.

I have also added support for data: URLs as https://github.com/nodejs/node/pull/31760#issuecomment-586323979 suggested.

aduh95

comment created time in 7 hours

push eventaduh95/node

Rich Trott

commit sha c2637847b36db987123e6c10d46b4abb2a078667

test: revise test-http-response-multi-content-length Isolate the two test cases here a bit more and refactor code. PR-URL: https://github.com/nodejs/node/pull/32526 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Gabriel Schulhof

commit sha 67d5c907d2dcf338306eaa74b910096b2a686fc4

src: unify Linux and FreeBSD large pages implem dl_iterate_phdr(3) is also available for FreeBSD. This change adds the same trimming code for the start and end of the .text section as on Linux, making it work on FreeBSD, and removing the need for the additional FreeBSD-specific check. Manually tested on * https://www.osboxes.org/freebsd/#freebsd-12-1-vbox * https://www.osboxes.org/freebsd/#freebsd-11-vbox * test-digitalocean-freebsd11-x64-2 Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com> PR-URL: https://github.com/nodejs/node/pull/32534 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>

view details

Nitin Kumar

commit sha be2f36a51a3c11b2001bd74e03a77cf3ee920aa0

doc: fix typo in maintaining-openssl guide PR-URL: https://github.com/nodejs/node/pull/32292 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>

view details

Nitin Kumar

commit sha 988f5bf6fb739950fe47ecc3c20853893ba729b0

doc: fix typo in maintaining-zlib guide PR-URL: https://github.com/nodejs/node/pull/32292 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>

view details

Nitin Kumar

commit sha 575b4e368d01b0be0a5f821d4c46b5aa8ff4b528

doc: fix typo in http2 docs PR-URL: https://github.com/nodejs/node/pull/32292 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>

view details

Christian Niederer

commit sha 8245a7816c8fb6e6b48f48d2fe36a3f360cf27d7

src: check for overflow when extending AliasedBufferBase When resizing an aliased_buffer check if the new size will overflow. PR-URL: https://github.com/nodejs/node/pull/31740 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

view details

Christian Niederer

commit sha babeb58c5286c55f00e6dfc48c0b609314bcc381

src: add aliased-buffer-overflow abort test Added native extension similar to test/addons/stringbytes-external-exceeded-max. Added an abort test to regression test the non overflow behaviour. PR-URL: https://github.com/nodejs/node/pull/31740 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

view details

Christian Niederer

commit sha e08ac095690015a8c488e05251e05feb2acc57a0

src: add test/abort build tasks The Aliased*Array overflow check test introduced a dependency to a compiled artifact. Add this artifact to the build process in a similar fashion as test/addons and test/js-native-api do. PR-URL: https://github.com/nodejs/node/pull/31740 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

view details

Daniele Belardi

commit sha d8f44bc2ed78d0ee396c8e21408872247cfe5a26

benchmark: add `no-var` rule in .eslintrc.yaml PR-URL: https://github.com/nodejs/node/pull/31794 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>

view details

Daniele Belardi

commit sha 435fe977e038ca5b778e39056a7a5ee69a5031df

benchmark: use const instead of var in async_hooks PR-URL: https://github.com/nodejs/node/pull/31794 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>

view details

Daniele Belardi

commit sha e18f5af270ad32699ca4b6eda63bd2aab683840b

benchmark: use let instead of var in common.js PR-URL: https://github.com/nodejs/node/pull/31794 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>

view details

Daniele Belardi

commit sha a2e70157829a8dada4226d1b7e5edd8c1f4b0b2f

benchmark: use let instead of var in dns PR-URL: https://github.com/nodejs/node/pull/31794 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>

view details

Daniele Belardi

commit sha 13ad05ce4c9adb05f68a13a3509e84b0649fb592

benchmark: use let instead of var in run.js PR-URL: https://github.com/nodejs/node/pull/31794 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>

view details

Daniele Belardi

commit sha de877c57813d7894c49a9cf32e644c04050c8cda

benchmark: use let instead of var in timers PR-URL: https://github.com/nodejs/node/pull/31794 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>

view details

Daniele Belardi

commit sha 8ec533d89015e03d1fccd188b53261424a7c93c6

benchmark: use let instead of var in tls PR-URL: https://github.com/nodejs/node/pull/31794 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>

view details

Daniele Belardi

commit sha a33e9c9d805e66207b15b663919f3122598c56ef

benchmark: use let instead of var in url PR-URL: https://github.com/nodejs/node/pull/31794 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>

view details

Daniele Belardi

commit sha d9a77c6416486c2203f35373aec33265c185bb70

benchmark: use let instead of var in util PR-URL: https://github.com/nodejs/node/pull/31794 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>

view details

Daniele Belardi

commit sha 806899fdbaf5e8e1b71f8a8f0efd61ef131350f5

benchmark: use let instead of var in worker PR-URL: https://github.com/nodejs/node/pull/31794 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>

view details

Daniele Belardi

commit sha 75aaf7496e1ff6272b5d76372aecbf6f37fbc3d4

benchmark: use let instead of var in zlib PR-URL: https://github.com/nodejs/node/pull/31794 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>

view details

Gus Caplan

commit sha 89ae1f1b73451ed40fa78d379e66d5c061f04548

util: fix inspecting document.all Fixes: https://github.com/nodejs/node/issues/31889 PR-URL: https://github.com/nodejs/node/pull/31938 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

view details

push time in 8 hours

push eventaduh95/node

Antoine du HAMEL

commit sha e9139b6883f83983092a7a7c3116d847343cbc80

Add lint rule for runtime deprecations

view details

push time in a day

push eventaduh95/node

Antoine du HAMEL

commit sha b593a56c55520a4e5a3cee1667d21fab4d7f31cb

Add lint rule for runtime deprecations

view details

push time in a day

pull request commentnodejs/node

doc: lint deprecation codes

@richardlau we could lint that all deprecation codes adhere to a specific format in lib.

That would cover runtime deprecation only right?

aduh95

comment created time in a day

delete branch aduh95/node

delete branch : update-deprecation-codes

delete time in a day

push eventaduh95/toml.wasm

Antoine du HAMEL

commit sha cb092ea00644d4620a1a3f9968cb70c6366e1a6f

Add web compatible API

view details

Antoine du HAMEL

commit sha 2e66bd7b4ead3b343fb6ecd72b8371e3b25d32b7

Add types back

view details

Antoine du HAMEL

commit sha 401a95b94a2bd85bee4fff727d82102fb68b12c6

Add Deno test and example

view details

Antoine du HAMEL

commit sha 188fe1ce707918388750a1cf6d56d902d2497979

Move scripts to a separate folder

view details

Antoine du HAMEL

commit sha 1d3aaca4ef10331c3c39140be9847cfc8ea1ef95

Use package.json version instead of Cargo.toml

view details

Antoine du HAMEL

commit sha 64d3ae2d9c7a90f17ff0976ef194a233c70a1c31

Add author to package metadata

view details

Antoine du HAMEL

commit sha ff5b16f5ed6f52dd1a6e47c32f9cb7cd79d41759

Add GitHub Actions scripts

view details

push time in 2 days

issue openeddenoland/deno

[Feature Request] WHATWG URL support for Deno FS methods

I would like to be able to do something like that:

await Deno.open(new URL('../relative/path.txt', import.meta.url));

Currently this fails the TypeScript type checking, and even when bypassing it, it throws a NotFound: No such file or directory (os error 2) error.

FWIW Node.js fs module methods support it, and IMO it would be a neat addition to Deno.

created time in 2 days

created tagaduh95/viz.js

tagv3.0.0

A hack to put Graphviz on the web.

created time in 3 days

push eventaduh95/viz.js

Antoine du HAMEL

commit sha 56c84dd53f26502131de1fb89f5c624fc911359b

Update deps

view details

Antoine du HAMEL

commit sha 68e63987fa51e99ed5447a05933c5646a27b184a

v3.0.0

view details

push time in 3 days

push eventaduh95/aduh95.github.io

Antoine du HAMEL

commit sha 391b616ebdde85a5d2117623ab1d7f57551eb86e

TOML pretifier warns for too long lines

view details

Antoine du HAMEL

commit sha b3223135f27ecb6f50349d51c053498dbc5e2237

Don't wait for DOMContentLoaded

view details

Antoine du HAMEL

commit sha 9b94cfa5650ff676334e55c694680cb43526e9d5

Open source in a new tab

view details

Antoine du HAMEL

commit sha a22660a15421547706762b641994a355c81390d0

TOML Prettifier: move outside current repo

view details

Antoine du HAMEL

commit sha 946660eb36285ce0a64b2feeac4df020413672e4

TOML prettifier: do not destroy files on error

view details

Antoine du HAMEL

commit sha 5cdb1a3d12d35dd4ee95242ea9398cef0387ba59

Prettify TOML files

view details

Antoine du HAMEL

commit sha 78bb79543e4dcfafc0c656dd834e70d20dec17ce

Fix IEEE 754 precision issue

view details

Antoine du HAMEL

commit sha 983b3e468da1a31e80937cf169e216b70a810ebb

v0.3.2

view details

push time in 4 days

created tagaduh95/toml-prettifier

tagv1.0.1

Opinionated TOML code formatter

created time in 4 days

push eventaduh95/toml-prettifier

Antoine du HAMEL

commit sha fe657ccb29f8ed7cf49651ab5d0823de8bd62e10

v1.0.1

view details

push time in 4 days

created tagaduh95/toml-prettifier

tagv1.0.0

Opinionated TOML code formatter

created time in 4 days

create barnchaduh95/toml-prettifier

branch : master

created branch time in 4 days

created repositoryaduh95/toml-prettifier

Opinionated TOML code formatter

created time in 4 days

created tagaduh95/toml-prettifier

tagv1.0.0

Opinionated TOML code formatter

created time in 4 days

push eventaduh95/toml-prettifier

Antoine du HAMEL

commit sha 34610dcbfa548a4ab62a433cb94b00f7999a44e1

meta: release script

view details

Antoine du HAMEL

commit sha 615c852068d610d59f47d880f6c238dc650bbf8a

meta: no lock file for the repo

view details

Antoine du HAMEL

commit sha 809e17ad4aab20f3b31140e995114e84a181a622

v1.0.0

view details

push time in 4 days

create barnchaduh95/toml-prettifier

branch : master

created branch time in 4 days

created repositoryaduh95/toml-prettifier

Opinionated TOML code formatter

created time in 4 days

pull request commentnodejs/remark-preset-lint-node

feat: flag unknown info strings

What would be the process for a contributor to add a language to that list? Let's say I'm a contributor that want to add a Rust example in the docs, is it still possible after this PR lands? It's probably not a big deal as it would happen very rarely, but a process is a nice to have. And even better if the error message refers to the process… What are your thoughts?

DerekNonGeneric

comment created time in 5 days

pull request commentnodejs/node

modules: runtime deprecate module.parent

Do we really need to do a runtime deprecation that quickly?

This PR won't land until v15 at the soonest, and it can also be blocked until v16 or later if we think it's too soon. I figured open the PR sooner rather than later would give more time for contributors to give their thoughts on this topic. Apologies if that was inappropriate.

aduh95

comment created time in 6 days

push eventaduh95/node

Antoine du HAMEL

commit sha b030017efe17e90e8641017be7a84941d5675501

Replace PR URL

view details

push time in 6 days

PR opened nodejs/node

modules: runtime deprecate module.parent

TL;DR: runtime warning when this module.parent is accessed from a module that have a nullish value for their module.parent (when a ESM imports it or when the module is run as the entry point of the process).

Currently, module.parent provides a way for CJS users to get which CJS modules required the current module first. This feature – not very useful by itself – is also used to make assumption about the program entry point. It is not rare to find packages that wrap their test code inside a if(!module.parent) condition, assuming that a falsy value means the module is run from CLI. The issue with this pattern is that the assumption doesn't work as soon as the module interacts with ESM or REPL.

With ESM being unflagged in current and LTS release lines, I predict this could become a real pain point for users trying to use ESM in Node.js.

Current issue

The issue I'd like to address is when a dependency is using the if(!module.parent) pattern to run its tests, and the test code gets executed for ESM users without their knowledge; those tests that may have side effects and make the end user code fail without obvious reason.

Action taken in this PR
  • set module.parent to a truthy value instead of undefined (in this PR, I'm using a dummy class UnknownModule).
  • add a runtime warning when module.parent is nullish, so it warns library authors not to use this pattern and end user facing the bug that it may impact their code.
Objections and alternative solutions
  • Instead of throwing when accessing module.parent.id, it would return undefined. I doubt that would impact any real world code though.
  • Some packages may use the if(!module.parent) pattern in their CLI exposed file. That would lead to end users seeing a warning they have no control over. I don't think there would be a lot of packages affected by this, but that's a possibility.

Refs: #32217

<!-- Thank you for your pull request. Please provide a description above and review the requirements below.

Bug fixes and new features should include tests and possibly benchmarks.

Contributors guide: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md -->

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

  • [x] make -j4 test (UNIX), or vcbuild test (Windows) passes
  • [x] tests and/or benchmarks are included
  • [x] documentation is changed or added
  • [x] commit message follows commit guidelines

<!-- Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or

(c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

(d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. -->

+60 -12

0 comment

8 changed files

pr created time in 6 days

create barnchaduh95/node

branch : runtime-deprecate-module-parent

created branch time in 6 days

delete branch aduh95/node

delete branch : deprecate-module-parent

delete time in 6 days

push eventaduh95/node

Antoine du Hamel

commit sha c51060dd088055b589cb4197f59e31547a2cb592

Remove pending deprecation test file

view details

push time in 6 days

push eventaduh95/node

Antoine du HAMEL

commit sha 51e15176c1f90229c311852b054045abfdb25017

Remove prending deprecation for backporting

view details

push time in 6 days

PR opened nodejs/node

[v14.x backport] modules: deprecate module.parent

Backport of #32217

<!-- Thank you for your pull request. Please provide a description above and review the requirements below.

Bug fixes and new features should include tests and possibly benchmarks.

Contributors guide: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md -->

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

  • [ ] make -j4 test (UNIX), or vcbuild test (Windows) passes
  • [x] tests and/or benchmarks are included
  • [x] documentation is changed or added
  • [x] commit message follows commit guidelines

<!-- Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or

(c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

(d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. -->

+66 -11

0 comment

9 changed files

pr created time in 6 days

create barnchaduh95/node

branch : backport-32217-to-current

created branch time in 6 days

pull request commentnodejs/node

modules: deprecate module.parent

Thank you for landing this! Should this get a Don't land on v14.x label? It does mutate the module object in order to enable the --pending-deprecation warning, I'm not sure if that may be breaking or not… I don't mind working on a backport without the --pending-deprecation trick if that helps.

aduh95

comment created time in 7 days

push eventaduh95/aduh95.github.io

Antoine du HAMEL

commit sha b2103731d5acde15996c3c459c707d72f3fd19d6

Fix footer on light theme

view details

Antoine du HAMEL

commit sha ff21458cc9005d08f032941f09e50bb88d7f8007

v0.3.1

view details

push time in 7 days

push eventaduh95/aduh95.github.io

Antoine du HAMEL

commit sha 8565177859c12fa7319544a055687b1446138b82

Add prettier script for TOML files

view details

Antoine du HAMEL

commit sha d44a0394b85d8a28f6621bed982c895adb53c0a3

Prettify TOML files

view details

Antoine du HAMEL

commit sha ea5b9fbecc1c896cae8ee937434cf7bfe4c333a8

Refactor SASS files

view details

Antoine du HAMEL

commit sha 16d1902446b654fa82ad234b7665798b4108e6e2

Add footer

view details

Antoine du HAMEL

commit sha e218584ca8762a39dfcc4166f823feeede67c40f

v0.3.0

view details

push time in 7 days

delete branch aduh95/node

delete branch : docserve

delete time in 7 days

delete branch aduh95/node

delete branch : fix-doc-pathToFileURL-example

delete time in 7 days

pull request commentnodejs/node

doc: merge CJS and ESM docs

I've split it into several commits as @devsnek suggested, each one with a small enough diff for GitHub UI.

We will also need some sort of redirect from esm.html which preserves the # fragment.

That would be on Node.js website side, right?

which sections in the new modules.md were unedited moves from esm.md and which had changes?

Some section have changed names:

  • modules.md ---> modules.md
    • Addenda: Package Manager Tips --> Tips for Package Manager Authors
    • The Module object --> Utility Methods
    • All Together... --> CommonJS Modules Resolution Algorithm
  • esm.md ---> modules.md
    • Enabling ---> Usage
    • Resolution Algorithm ---> ECMAScript Modules Resolution Algorithm

The content of the sections has not changed (except minor stuff like links and eslint comments).

aduh95

comment created time in 8 days

push eventaduh95/node

Antoine du HAMEL

commit sha ff8a62474e48da02385fc6b7022232db8cde2272

doc: merge CJS and ESM docs Documents package.json supported fields. Fixes: https://github.com/nodejs/node/issues/33143

view details

Antoine du HAMEL

commit sha ce340ee60b7f227edae2f931bf04359766ab82e2

Refactor modules.md CJS sections

view details

Antoine du HAMEL

commit sha 001af74c310444efe37bc7fbe13afb8dfe5068ea

esm intro

view details

Antoine du HAMEL

commit sha 897b18a5014ceb127882d0b42c7183c03bdedb6b

Move ESM specific doc to modules.md

view details

Antoine du HAMEL

commit sha 66b6fb8715e0e1b1b7b0303d334821da2240bad4

Move Packages section to modules.md

view details

Antoine du HAMEL

commit sha 4574135e3332ecb1243372f98bc964b6ffd9283b

Move Dual Module Packages section to modules.md

view details

Antoine du HAMEL

commit sha 6438e8f6fcc8c7cd3d911121a8dee047244af94a

Move ESM resolution algo doc to modules.md

view details

Antoine du HAMEL

commit sha 25e58f5687d6b1df6538a9d5083f97f303e59285

Add package.json documentation

view details

Antoine du HAMEL

commit sha a0d497b8b6de8cefe29cc8313501c6033fb376ee

Fix links

view details

Antoine du HAMEL

commit sha eadbb2b44d561c8336366b6386fcd27bdd377aba

Add redirect link from esm.md to modules.md

view details

Antoine du HAMEL

commit sha a3029c731c6dc77e8f360aa78ab4ef621c00affb

Remove esm.md to make the tests pass

view details

push time in 8 days

PR opened nodejs/node

doc: merge CJS and ESM docs

Based on @GeoffreyBooth's suggestion in https://github.com/nodejs/node/pull/32970#issuecomment-631886715.

Documents package.json supported fields.

Fixes: https://github.com/nodejs/node/issues/33143 Alternate to #32970

<!-- Thank you for your pull request. Please provide a description above and review the requirements below.

Bug fixes and new features should include tests and possibly benchmarks.

Contributors guide: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md -->

<!-- Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or

(c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

(d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. -->

Problem this PR is trying to solve

Node.js has recently started to rely more on the package.json file, and I feel it would be helpful to have a separate document defining the fields we use (a bit like the guide on npm docs).

Currently, there are features supported by both ESM and CJS loaders, and it is documented in one arbitrary file (E.G.: Conditional Exports is documented in esm.md only, Source Maps API in modules.md only, …).

This PR merges the two documents (as well as the package.json documentation from #32970) in the modules.md file.

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

  • [x] make -j4 test (UNIX), or vcbuild test (Windows) passes
  • [x] documentation is changed or added
  • [x] commit message follows commit guidelines
+2226 -2120

0 comment

7 changed files

pr created time in 8 days

create barnchaduh95/node

branch : merge-cjs-esm-docs

created branch time in 8 days

push eventaduh95/yuml2svg

Antoine du HAMEL

commit sha c1e2558f1d69fa2d33f72ae829f661330c03b181

Update deps

view details

Antoine du HAMEL

commit sha 4b97b6111e5fd49a0e7d80785f3a6de3ca7fd29d

Fix types

view details

Antoine du HAMEL

commit sha 11fefe12ea0cdeede47e27c946c65f4a8f0d7a8e

Automate npm release

view details

push time in 9 days

push eventaduh95/viz.js

Antoine du HAMEL

commit sha 6b953e4452c67202d1c2a422cfacde5a8af86779

publish: more tests and autoupdate changelog release date

view details

Antoine du HAMEL

commit sha 6d6be4be8d63cbb5315305637529651aad846269

publish: detect prerelease in GH Action

view details

push time in 9 days

created tagaduh95/schwifty-markdown

tagv2.0.0-beta.16

Convert Markdown documents to HTML on the fly, including yUML and Plantuml diagrams and graph charts rendering

created time in 9 days

push eventaduh95/schwifty-markdown

Antoine du HAMEL

commit sha b11c577df02e77380ec429ca509e3cec505b53e6

v2.0.0-beta.16

view details

push time in 9 days

created tagaduh95/schwifty-markdown

tagv2.0.0-beta.15

Convert Markdown documents to HTML on the fly, including yUML and Plantuml diagrams and graph charts rendering

created time in 9 days

push eventaduh95/schwifty-markdown

Antoine du HAMEL

commit sha 480a87602bb5328e6cbf3f25e86e8308af03671b

v2.0.0-beta.15

view details

push time in 9 days

created tagaduh95/schwifty-markdown

tagv2.0.0-beta.14

Convert Markdown documents to HTML on the fly, including yUML and Plantuml diagrams and graph charts rendering

created time in 9 days

push eventaduh95/schwifty-markdown

Antoine du HAMEL

commit sha 1c36b0b0e2105233c56b9697a5506380ab83888a

v2.0.0-beta.14

view details

push time in 9 days

created tagaduh95/schwifty-markdown

tagv2.0.0-beta.13

Convert Markdown documents to HTML on the fly, including yUML and Plantuml diagrams and graph charts rendering

created time in 9 days

push eventaduh95/schwifty-markdown

Antoine du HAMEL

commit sha 64debfd23805da3911fc61bf0ebe27a5b52472ae

v2.0.0-beta.13

view details

push time in 9 days

created tagaduh95/schwifty-markdown

tagv2.0.0-beta.12

Convert Markdown documents to HTML on the fly, including yUML and Plantuml diagrams and graph charts rendering

created time in 9 days

push eventaduh95/schwifty-markdown

Antoine du HAMEL

commit sha dd11e92afdc081152678a6049d59e5f62b360dae

v2.0.0-beta.12

view details

push time in 9 days

created tagaduh95/schwifty-markdown

tagv2.0.0-beta.11

Convert Markdown documents to HTML on the fly, including yUML and Plantuml diagrams and graph charts rendering

created time in 9 days

push eventaduh95/schwifty-markdown

Antoine du HAMEL

commit sha 5b2cde0f20b7aa9e5641c28c94d3837c5e938070

v2.0.0-beta.11

view details

push time in 9 days

created tagaduh95/schwifty-markdown

tagv2.0.0-test.ci.2

Convert Markdown documents to HTML on the fly, including yUML and Plantuml diagrams and graph charts rendering

created time in 9 days

push eventaduh95/schwifty-markdown

Antoine du HAMEL

commit sha 78e45e98ee4d78f580bd642f5b7c36c1317f63c3

v2.0.0-test.ci.2

view details

push time in 9 days

created tagaduh95/schwifty-markdown

tagv2.0.0-test.ci

Convert Markdown documents to HTML on the fly, including yUML and Plantuml diagrams and graph charts rendering

created time in 9 days

push eventaduh95/schwifty-markdown

Antoine du HAMEL

commit sha dbf5f1212ba09ffd8fc46a65c2129cb7d89b4712

v2.0.0-test.ci

view details

push time in 9 days

created tagaduh95/schwifty-markdown

tagv2.0.0-beta.test.ci-2

Convert Markdown documents to HTML on the fly, including yUML and Plantuml diagrams and graph charts rendering

created time in 9 days

push eventaduh95/schwifty-markdown

Antoine du HAMEL

commit sha ec27360a6ec6b08bb83970a37f7eeb03b82e5fd0

v2.0.0-beta.test.ci-2

view details

push time in 9 days

created tagaduh95/schwifty-markdown

tagv2.0.0-beta.test.ci

Convert Markdown documents to HTML on the fly, including yUML and Plantuml diagrams and graph charts rendering

created time in 9 days

push eventaduh95/schwifty-markdown

Antoine du HAMEL

commit sha 323c126618a276a82f16487ddb00096fd3478019

v2.0.0-beta.test.ci

view details

push time in 9 days

created tagaduh95/schwifty-markdown

tagv2.0.0-alpha.test.ci

Convert Markdown documents to HTML on the fly, including yUML and Plantuml diagrams and graph charts rendering

created time in 9 days

push eventaduh95/schwifty-markdown

Antoine du HAMEL

commit sha 966a77192b11f5bcb3fa21a188dd372dfeffcb62

Fix stdin detection

view details

Antoine du HAMEL

commit sha 98dc779d6988d4b80b0846e3844600cc05e9749d

Update deps

view details

Antoine du HAMEL

commit sha 01a037fa00df484e98bf13a9a944549d3d5e05f8

Re-enable Java during tests

view details

Antoine du HAMEL

commit sha d544208ee8af7501f1ce2976d246ce65ac5a2a8a

v2.0.0-alpha.test.ci

view details

push time in 9 days

push eventaduh95/aduh95.github.io

Antoine du HAMEL

commit sha 0b6e094e3c1bf267788e3b28e9c09c14c70ab3ed

Fix error on Windows

view details

push time in 10 days

push eventaduh95/viz.js

Antoine du HAMEL

commit sha c45bedf71e051fec90b2f251c00a9c900acceba3

GH Actions: automate release creation

view details

push time in 10 days

created tagaduh95/viz.js

tagv3.0.0-rc.5

A hack to put Graphviz on the web.

created time in 10 days

push eventaduh95/viz.js

Antoine du HAMEL

commit sha 8472d002f954170e8ff62e920ab0dfa431918a2f

GH Actions: create release

view details

push time in 10 days

created tagaduh95/viz.js

tagv3.0.0-rc.4

A hack to put Graphviz on the web.

created time in 10 days

push eventaduh95/viz.js

Antoine du HAMEL

commit sha cae7c57a15f98b43ee00df9a619f54d7f3a487ce

GH Actions: create release

view details

push time in 10 days

created tagaduh95/viz.js

tagv3.0.0-rc.3

A hack to put Graphviz on the web.

created time in 10 days

push eventaduh95/viz.js

Antoine du HAMEL

commit sha 96b2a6d6eb8674cfb31bad049b9cb9847c14fdc1

GH Actions: create release

view details

push time in 10 days

created tagaduh95/viz.js

tagv3.0.0-rc.2

A hack to put Graphviz on the web.

created time in 10 days

push eventaduh95/viz.js

Antoine du HAMEL

commit sha f63005984f09a73b8cfccec6c1749fce7b4dbdfa

GH Actions: create release

view details

push time in 10 days

created tagaduh95/viz.js

tagv3.0.0-rc.1

A hack to put Graphviz on the web.

created time in 10 days

push eventaduh95/viz.js

Antoine du HAMEL

commit sha b49922f95a02ea1783003ae85da4df69240b52b3

GH Actions: create release

view details

push time in 10 days

created tagaduh95/viz.js

tagv3.0.0-rc

A hack to put Graphviz on the web.

created time in 10 days

push eventaduh95/viz.js

Antoine du HAMEL

commit sha 35bea642e606364e1f0594327ef6ff6016fe33b0

v3.0.0-rc

view details

push time in 10 days

push eventaduh95/viz.js

Antoine du HAMEL

commit sha 31d1d05a286a60439834efbc3ca34556a17365e1

Test GitHub Action CI

view details

push time in 10 days

push eventaduh95/viz.js

Antoine du HAMEL

commit sha f573c108a95f86296c84ba788a4f60680788cf3a

nit: fix typo

view details

Antoine du HAMEL

commit sha 8c9ad1f7eac4353cde2f8a381275ba5a266dc313

doc: Improve JsDoc comments

view details

Antoine du HAMEL

commit sha 8a7c90deaab5c8f439e5c008769c12c787ca84bd

Upgrade deps

view details

Antoine du HAMEL

commit sha 55fe9228688c8a46f5141b2c3da9ac9f98eb0819

Fix render_sync on Emscripten 1.39.16

view details

push time in 10 days

pull request commentnodejs/node

modules: deprecate module.parent

CI is green, Violets are blue, I would very much like See this PR go through! 😅

aduh95

comment created time in 10 days

push eventaduh95/node

Anna Henningsen

commit sha 0e5b975873e88d9276dd8f1e1d94b8f66e741155

src: add default: case to silence compiler warning This fails compilation on at least one platform because there is no `default:` case, despite all currently possible enum values being listed. Fix that by adding a default message that won’t be used unless V8 introduces new enum values. Refs: https://github.com/nodejs/node/commit/c7eeef568ce5a3714b89689160ec85c017527364#commitcomment-39228519 PR-URL: https://github.com/nodejs/node/pull/33451 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>

view details

Robert Nagy

commit sha 2361b5c041893cae3f84e412b67e4978af7af3c7

stream: forward writableObjectMode Duplex did not properly forward writableObjectMode. Fixes: https://github.com/nodejs/node/issues/33388 PR-URL: https://github.com/nodejs/node/pull/33390 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

Andrew Paprocki

commit sha fe1b9e09a845e24556f417553b4b434636fdd5ee

doc: document ICU time zone data update process Updates the "Maintaining ICU" document and describes the process to update an existing ICU `.dat` file with updated binary time zone data files corresponding to new IANA `tzdata` releases. Requested in nodejs/node#30211 by @srl295 PR-URL: https://github.com/nodejs/node/pull/30364 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>

view details

Joyee Cheung

commit sha 8b0bdc918ec2731db34cebc934b96e0e4ad2b1a6

doc: clarify about the Node.js-only extensions in perf_hooks - Add clarifications for Node.js-only extensions - Explain the Web Performance APIs implemented in Node.js and clarify that perf_hooks also include other non-Web APIs. - Prefix exposed interfaces with `perf_hooks.` to distinguish them from internal classes. PR-URL: https://github.com/nodejs/node/pull/33199 Refs: https://github.com/nodejs/node/issues/28635 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

view details

Shelley Vohr

commit sha ed9be3ab477e977f973504955897c23d578b276c

deps: update icu to include tzdata2020a PR-URL: https://github.com/nodejs/node/pull/33362 Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>

view details

cjihrig

commit sha 227ad25cc684d3dcde82c2f370ab25d3d06364b3

deps: upgrade to libuv 1.38.0 Notable changes: - `uv_library_shutdown()` has been added. - `uv_udp_init_ex()` now accepts `UV_UDP_RECVMMSG`, although it is a no-op. - Obsolete `MAX_PATH` restrictions have been removed on Windows, and Windows is now long path aware. - Windows environment variables longer than 32,767 characters are now supported. - Linux `cpu_times` are now reported as milliseconds to match other platforms. - A memory leak resulting from `uv_loop_init()` failures has been fixed. PR-URL: https://github.com/nodejs/node/pull/33446 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Richard Lau <riclau@uk.ibm.com>

view details

cjihrig

commit sha 3abb52fdb683c9c9ade1b2c7d16d0f640bbaacfd

deps: update to uvwasi 0.0.9 Notable changes: - A `DEBUG()` macro and `UVWASI_DEBUG_LOG` build option have been added to improve debugging. - Path length restrictions have been removed across the codebase. - Initial support for `poll_oneoff()` has been added on all platforms. The implementation is based on `uv_poll_t`'s. - A new `uvwasi_size_t` has been introduced across the WASI system call API. This provides consistent 32-bit `size_t`'s. - The cmake test targets are now only generated if uvwasi is the root project to avoid conflicts with targets from embedders. - `uv.h` has been removed from the public headers. - A serialization/deserialization API has been added to simplify the process of working with WASM memory. This also hides many WASI <--> WASM interfacing implementation details from embedders. - A memory corruption bug on Windows related to path resolution has been fixed. PR-URL: https://github.com/nodejs/node/pull/33445 Fixes: https://github.com/nodejs/node/issues/33403 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>

view details

Benjamin Gruenbaum

commit sha b51d1cfbf27529346c7134f8fc4a855229543cc2

doc: add comment about highWaterMark limit Add a comment regarding memory limits and setting highWaterMark PR-URL: https://github.com/nodejs/node/pull/33432 Reviewd-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

view details

Jonathan Buhacoff

commit sha d093e788d188d0affffebb016ef8e50fda678ab6

doc: update function description for `decipher.setAAD` According to the [NodeJS CCM example](https://nodejs.org/docs/latest-v14.x/api/crypto.html#crypto_ccm_mode], when decrypting the `plaintextLength` parameter actually refers to the ciphertext length, not the plaintext length: ``` decipher.setAAD(aad, { plaintextLength: ciphertext.length }); ``` The same can be seen in the [OpenSSL docs](https://wiki.openssl.org/index.php/EVP_Authenticated_Encryption_and_Decryption) where a call to `EVP_DecryptUpdate` passes the ciphertext length: ``` /* Provide the total ciphertext length */ if(1 != EVP_DecryptUpdate(ctx, NULL, &len, NULL, ciphertext_len)) handleErrors(); ``` This parameter probably should have been called `inputLength` or `bufferLength` instead of `plaintextLength`, so that it makes sense both when encrypting and decrypting, but at least we can correct the sentence in the documentation for now to refer to the correct value. PR-URL: https://github.com/nodejs/node/pull/33095 Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

view details

Richard Townsend

commit sha 66807e995de9a16b1cfe035f76958a178c381854

tools,gyp: add support for MSVC cross-compilation This change means that GYP can now generate two sets of projects: one exclusively for a host x64 machine and one containing a mix of x64 and Arm targets. The names of host targets are fixed up to end with _host.exe, and any actions involving them are fixed up. This allows compilation of Node on an x64 server for a Windows on Arm target. PR-URL: https://github.com/nodejs/node/pull/32867 Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: João Reis <reis@janeasystems.com>

view details

Richard Townsend

commit sha 883355125766e35126006507d1d8a09c149fc71d

build,win: add support for MSVC cross-compilation * Fixes cases in icutools where commands were issued without .exe * Changes to build scripts * Add /fp:strict flag so that MSVC's floating point behaves correctly * Enables marmasm PR-URL: https://github.com/nodejs/node/pull/32867 Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: João Reis <reis@janeasystems.com>

view details

Shelley Vohr

commit sha c841f516d530f31328b1f734428561d93bb14f4c

2020-05-19, Version 14.3.0 (Current) Notable changes: async_hooks: * (SEMVER-MINOR) move PromiseHook handler to JS (Stephen Belanger) https://github.com/nodejs/node/pull/32891 cli: * (SEMVER-MINOR) add `--trace-atomics-wait` flag (Anna Henningsen) https://github.com/nodejs/node/pull/33292 fs: * (SEMVER-MINOR) add .ref() and .unref() methods to watcher classes (rickyes) https://github.com/nodejs/node/pull/33134 http: * (SEMVER-MINOR) expose http.validate-header-name/value (osher) https://github.com/nodejs/node/pull/33119 repl: * (SEMVER-MINOR) deprecate repl._builtinLibs (Ruben Bridgewater) https://github.com/nodejs/node/pull/33294 * (SEMVER-MINOR) deprecate repl.inputStream and repl.outputStream (Ruben Bridgewater) https://github.com/nodejs/node/pull/33294 * (SEMVER-MINOR) show reference errors during preview (Ruben Bridgewater) https://github.com/nodejs/node/pull/33282 * (SEMVER-MINOR) improve repl preview (Ruben Bridgewater) https://github.com/nodejs/node/pull/33282 src: * add support for TLA (Gus Caplan) https://github.com/nodejs/node/pull/30370 PR-URL: https://github.com/nodejs/node/pull/33452

view details

Anna Henningsen

commit sha 7c755b06cee4cf3c3e3841fb891670122f50ee24

build: run full test suite in ASAN action Refs: https://github.com/nodejs/node/pull/32776 PR-URL: https://github.com/nodejs/node/pull/33170 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me>

view details

Daniel Bevenius

commit sha 61189d3981ef49885f8d98eef2ac0207b6e59f40

src: reduce duplication in RegisterHandleCleanups This commit suggest using a lambda for the RegisterHandlerCleanup calls in RegisterHandleCleanups. The motivation is to reduce some duplication and to make it a little easier to read as all of the calls pass in the same arguments, apart from casting the uv handle. PR-URL: https://github.com/nodejs/node/pull/33421 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: David Carlier <devnexen@gmail.com>

view details

Anna Henningsen

commit sha 0e92ae64f01140bc527b5a02d7f154dca882ef09

worker: fix race condition in node_messaging.cc `AddToIncomingQueue()` relies on `owner_` only being modified with `mutex_` being locked, but in these two places, that didn’t happen. Modify them to use `Detach()` instead, which has the same effect as setting `owner_ = nullptr` here, but does it with proper locking. This race condition probably only shows up in practice when Node.js is compiled in debug mode, because the compiler eliminates the duplicate load in `AddToIncomingQueue()` when compiling with optimizations enabled. PR-URL: https://github.com/nodejs/node/pull/33429 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Pranshu Srivastava

commit sha ee8756760cf788a7a22091613597c03dceeb3e24

http2: comment on usage of `Object.create(null)` Refs: https://github.com/nodejs/node/issues/29829 PR-URL: https://github.com/nodejs/node/pull/33183 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

view details

Tobias Nießen

commit sha 1786504afa068b2b6591f23799dadd4e867cc529

doc: fix typos in handle scope descriptions PR-URL: https://github.com/nodejs/node/pull/33267 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Masashi Hirano <shisama07@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>

view details

Ethan Arrowood

commit sha 38f444060b0527afe5dccc44ee2db55c73c62e57

doc: add fs.open() multiple constants example PR-URL: https://github.com/nodejs/node/pull/33281 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

Antoine du Hamel

commit sha a82001a387afa133590420c98efb6b87ad320bfb

doc: document module.path Refs: https://github.com/nodejs/node/pull/26970 Fixes: https://github.com/nodejs/node/issues/33270 PR-URL: https://github.com/nodejs/node/pull/33323 Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

delvedor

commit sha daa65fba7d413691d55051457993405457fa2f41

http: added scheduling option to http agent In some cases, it is preferable to use a lifo scheduling strategy for the free sockets instead of default one, which is fifo. This commit introduces a scheduling option to add the ability to choose which strategy best fits your needs. PR-URL: https://github.com/nodejs/node/pull/33278 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>

view details

push time in 10 days

push eventaduh95/toml.wasm

Antoine du HAMEL

commit sha 12c351694e19d7fc998ed55cd0294c025970e6d9

Fix CJS to ESM exports with underscore

view details

Antoine du HAMEL

commit sha f511d29f01fda56a28ec8a9ed6da34bb402ed43d

v0.2.1

view details

push time in 11 days

created tagaduh95/toml.wasm

tagv0.2.0

Parse TOML to JS objects and the other way around

created time in 11 days

created tagaduh95/toml.wasm

tagv0.2.1

Parse TOML to JS objects and the other way around

created time in 11 days

push eventaduh95/toml.wasm

Antoine du HAMEL

commit sha e98a6153d3caf29e42338f0011e3af6d737902b0

Remove JSON dependency

view details

Antoine du HAMEL

commit sha 22b027e350b8d8fdf05d1162d7684ba0999200b1

Add stringify method

view details

Antoine du HAMEL

commit sha 1cf37cf389798b91c9e6fe81da6f5434a1fe10a8

nit: code style

view details

Antoine du HAMEL

commit sha 0041f2d821fdb563bedf1a12ab1ece26d614a6b8

v0.2.0

view details

Antoine du HAMEL

commit sha 8c8b684f8339c2a12cee31d15ac7427c1243b918

Enrich package.json metadata

view details

push time in 11 days

push eventaduh95/aduh95.github.io

Antoine du HAMEL

commit sha 6a8af4329858b3d1ab17baf52b4052c37868a6bf

Get rid of CJS rollup plugin

view details

Antoine du HAMEL

commit sha aec9b5e3f9426d0e32858d777d2b2ee4eab9e5a8

Fix failing test

view details

Antoine du HAMEL

commit sha 7ba4f55d398b7d27015cb7eb7b3b9b3a00dec2b6

Optimize rollup-plugin-sass

view details

Antoine du HAMEL

commit sha 64bb5c6f83f9963aef7dd21e9e5ebcade45cd5c1

Make header.tsx consistent

view details

Antoine du HAMEL

commit sha 935a30be0022cb50bac89df2c22d40feedcfba41

src: refactor some modules Hide implementation details at the end of file when possible to improve readability and ease debug process

view details

Antoine du HAMEL

commit sha 1feab491ad244b6fca5a8602db0b0f91854e0698

Replace JSON modules with TOML files

view details

Antoine du HAMEL

commit sha baf57528d668f842e75d8cb4e39b343d1ceae90b

Add __auto_imports__ to TOML modules

view details

Antoine du HAMEL

commit sha 896a268d7202e4fd8c1deab8b754152fd267d10d

Improve build perf

view details

Antoine du HAMEL

commit sha b7c473bfc45b5471ccb0f699c396c4481be2d53e

Recover from worker crash

view details

Antoine du HAMEL

commit sha c5fd6c7737a38f4559f8c2dfc1ca74f4c73d05b8

Add links to fontawesome to help find icons

view details

Antoine du HAMEL

commit sha 0c8bdd0e7cf09af8f3ee62f106066990d6e08afe

Add comments to TOML files to improve readability

view details

Antoine du HAMEL

commit sha 4ebd1d6ac3d39f7ef30e505f307f143917b789da

Fix crash on build chain on a race condition

view details

Antoine du HAMEL

commit sha acd74ced95540e2072f458f309ae89ecc593197e

Improve readability of TOML d.ts files

view details

Antoine du HAMEL

commit sha a44e0648e812cd5d455ee04fcdf17230af8cde7f

Prettify experience.toml

view details

Antoine du HAMEL

commit sha 41402e50c1777b787f267880a7591f8a504ee979

toml: improve .d.ts output Don't include synthetic exports when global scope is generic and add a line return at the end of the file.

view details

Antoine du HAMEL

commit sha 4f9a7b45bfa612edd64b3285567e83c2b38829c3

Build toml.d.ts files before rollup build This is to ensure the TS compiler has up-to-date types available.

view details

Antoine du HAMEL

commit sha 36527e85098e492675ddfcebfb3e8a4bb3a84520

watch: avoid sending rebuild signal twice to improve perf

view details

Antoine du HAMEL

commit sha a4fe5f332006fc7a7ebeaecb33adde3cd4328e5f

Fix languages ordering

view details

Antoine du HAMEL

commit sha 44bb75495c3f008d88e955a6bcb008d29fc0085d

Fix experience info ordering

view details

Antoine du HAMEL

commit sha f33dcc490a41579138572917581d7493d8c74541

deps: update TOML parser

view details

push time in 11 days

push eventaduh95/node

Ujjwal Sharma

commit sha b37ec37210237ab65040948791916912c4ab055d

deps: V8: backport 3f8dc4b2e5ba Original commit message: [intl] Remove soon-to-be removed getAllFieldPositions Needed to land ICU67.1 soon. Bug: v8:10393 Change-Id: I3c7737ca600d6ccfdc46ffaddfb318ce60bc7618 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2136489 Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Frank Tang <ftang@chromium.org> Cr-Commit-Position: refs/heads/master@{#67027} Refs: https://github.com/v8/v8/commit/3f8dc4b2e5baf77b463334c769af85b79d8c1463 PR-URL: https://github.com/nodejs/node/pull/32993 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Steven R Loomis <srloomis@us.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>

view details

rickyes

commit sha 58682d823acb0e566f16d1d8b33b83dfebf3aa5d

tls: add highWaterMark option for connect PR-URL: https://github.com/nodejs/node/pull/32786 Fixes: https://github.com/nodejs/node/issues/32781 Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>

view details

Hassaan Pasha

commit sha 5509c6355cd25deed34c8ecc28753fb79e65ad2b

deps: upgrade openssl sources to 1.1.1g This updates all sources in deps/openssl/openssl by: $ cd deps/openssl/ $ rm -rf openssl $ tar zxf ~/tmp/openssl-1.1.1g.tar.gz $ mv openssl-1.1.1g openssl $ git add --all openssl $ git commit openssl PR-URL: https://github.com/nodejs/node/pull/32971 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>

view details

Hassaan Pasha

commit sha 9f14584f2aa10fe7eb3496f9665f1caf81d23419

deps: update archs files for OpenSSL-1.1.1g After an OpenSSL source update, all the config files need to be regenerated and committed by: $ cd deps/openssl/config $ make $ git add deps/openssl/config/archs $ git add deps/openssl/openssl/include/crypto/bn_conf.h $ git add deps/openssl/openssl/include/crypto/dso_conf.h $ git add deps/openssl/openssl/include/openssl/opensslconf.h $ git commit PR-URL: https://github.com/nodejs/node/pull/32971 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>

view details

Robert Nagy

commit sha f5c11a1a0a074603ad55889dbd4125396a47c95e

stream: don't emit finish after close Writable stream could emit 'finish' after 'close'. PR-URL: https://github.com/nodejs/node/pull/32933 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>

view details

Robert Nagy

commit sha c15a27cab363e0e958bdec437a90fcb8b3842dde

stream: don't wait for close on legacy streams Try to detect non standard streams and don't wait for 'close' on these. In particular if we detected that destroyed is true before we expect it to be then fallback to compat behavior. Fixes: https://github.com/nodejs/node/issues/33050 PR-URL: https://github.com/nodejs/node/pull/33058 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com>

view details

Juan José Arboleda

commit sha 75e4ccb192ea642502b02fe5d61f8a66e74c474a

doc: add documentation for transferList arg at worker threads Ref: https://github.com/nodejs/node/pull/32278 PR-URL: https://github.com/nodejs/node/pull/32881 Refs: https://github.com/nodejs/node/pull/32278 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

view details

Christopher Beeson

commit sha 540f2785ddfd8c1ce6267fb99d0bdc9f2ab33bcb

worker: fix process.env var empty key access PR-URL: https://github.com/nodejs/node/pull/32921 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>

view details

Christopher Beeson

commit sha 3ccdf8ad228379703e721c179339c332add0842c

src: fix empty-named env var assertion failure Setting an environment variable with an empty name on Windows resulted in an assertion failure, because it was checked for an '=' sign at the beginning without verifying the length was greater than 0. Fixes: https://github.com/nodejs/node/issues/32920 Refs: https://github.com/nodejs/node/pull/27310 PR-URL: https://github.com/nodejs/node/pull/32921 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>

view details

Christopher Beeson

commit sha 20e0cc0592270bac03852120ec05f4b483b05ccb

src: do not compare against wide characters PR-URL: https://github.com/nodejs/node/pull/32921 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>

view details

Yash Ladha

commit sha b2768ae185bf1256282ea2fda9a04dd3b7bbf1bf

cluster: removed unused addressType argument from constructor When intializing the constructor for cluster master we are heavily using a generic structure, but the effect of passing arguments that are related to shared_handle is that there is a stale argument passed. We can avoid such scenarios as all the remaining entities are being destructured from the message object. PR-URL: https://github.com/nodejs/node/pull/32963 Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>

view details

Anna Henningsen

commit sha 38998d85384f85fd36fb478d20557d80de886949

module: do not warn when accessing `__esModule` of unfinished exports Since this property access is performed by generated code, and not used for accessing the actual exports of a module (and because transpilers generally define it as the first key of `module.exports` when it *is* present), it should be okay to allow it. Refs: https://github.com/nodejs/node/pull/29935 Fixes: https://github.com/nodejs/node/issues/33046 PR-URL: https://github.com/nodejs/node/pull/33048 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com>

view details

Anna Henningsen

commit sha 6068c72ae383c314412af933bb78918df892167a

util,readline: NFC-normalize strings before getStringWidth The assumption here is that decomposed characters render like their composed character equivalents, and that working with the former comes with a risk of over-estimating string widths given that we compute them on a per-code-point basis. The regression test added here (한글 vs 한글) is an example of that happening. PR-URL: https://github.com/nodejs/node/pull/33052 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

himself65

commit sha d027f71100be11b21605faf75e83bc1abb9bb86a

test: refactor test-async-hooks-constructor PR-URL: https://github.com/nodejs/node/pull/33063 Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Robert Nagy

commit sha e5512acfa737b86dac0906414d2b34ab1ca6c6d0

doc: document major finished changes in v14 Added description of semver-major changes to finished in v14. PR-URL: https://github.com/nodejs/node/pull/33065 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

Stephen Belanger

commit sha a8236e0f710c9b28febca6e4294f751b11ad72a9

src: add AsyncWrapObject constructor template factory PR-URL: https://github.com/nodejs/node/pull/33051 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>

view details

Michaël Zasso

commit sha 16d794dae64529f908659fca97370760bfd89fc2

doc: improve release documentation Extract the "Cherry-pick the Release Commit to master" part to its own section and be more precise about what should be done to handle conflicts. PR-URL: https://github.com/nodejs/node/pull/33042 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>

view details

Myles Borins

commit sha 2439071e18dd625d0f91bd2be3eb8b7fc6894eaf

module: refactor condition PR-URL: https://github.com/nodejs/node/pull/32989 Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>

view details

Sam Roberts

commit sha 684a81d023dc4071c31b994f0447d3401af228f8

doc: make openssl maintenance position independent It used to have some `cd` commands that if done literally would invalidate the subsequent commands. Modify them to be more accurate, which also simplifies pasting them directly into the console from the guide while doing an update. PR-URL: https://github.com/nodejs/node/pull/32977 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>

view details

Thomas

commit sha 4e8797353c86ba86799ce0d19236d133188f1c9d

build: fix vcbuild error for missing Visual Studio The previous error was wrongly redirecting users to the ICU installation steps, which is unrelated to missing Visual Studio. PR-URL: https://github.com/nodejs/node/pull/32658 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>

view details

push time in 12 days

push eventaduh95/node

Gus Caplan

commit sha b46bbf2e1990999fcf1a6beebf761ba2a95bc435

doc: fix extension in esm example PR-URL: https://github.com/nodejs/node/pull/33408 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>

view details

Rich Trott

commit sha bea0ee803302b9bb72b6ecf7a799fc2264ee1389

doc: prepare 14.x changelog for remark update Add a comment to disable a rule in the 14.x changelog that will be needed once we update remark lint dependencies. This comment appears in the other changelogs. Refs: https://github.com/nodejs/remark-preset-lint-node/pull/89#issuecomment-628978791 PR-URL: https://github.com/nodejs/node/pull/33412 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com>

view details

Rich Trott

commit sha b3ca8869a6d76de9c7f54bbcf7fbfc8a5b7d2bf4

tools: update dependencies for markdown linting PR-URL: https://github.com/nodejs/node/pull/33412 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com>

view details

Thomas

commit sha 1c619143eb449dd021142cd40c5891cbc2edb578

errors: skip fatal error highlighting on windows Some consoles do not convert ANSI escape sequences to colors, rather display them directly to the stdout. On those consoles, libuv emulates colors by intercepting stdout stream and calling corresponding Windows API functions for setting console colors. However, fatal error are handled differently and we cannot easily highlight them. PR-URL: https://github.com/nodejs/node/pull/33132 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

view details

Antoine du HAMEL

commit sha a12a2d892fadf8d8f6c5482056b937c9e1f89df4

repl: update deprecation codes Refs: https://github.com/nodejs/node/pull/33294 PR-URL: https://github.com/nodejs/node/pull/33430 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>

view details

Daniel Bevenius

commit sha b477ac83e6082fe0e76fb4c640cbfe7b864bbd02

src: add promise_resolve to SetupHooks comment This commit adds promise_resolve to the list of callbacks mentioned in the comment. It also fixes a minor typo, every -> ever. PR-URL: https://github.com/nodejs/node/pull/33365 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Daniel Bevenius

commit sha ebffd229a10ed25bff1b1aa37a8314f0e093c689

src: remove unused misc variable This commit removes the unused 'misc' variable from one of the NodeMainInstance constructors. Another option could be to add a default argument to SetIsolateMiscHandlers but I'd like to hear what others think about that first. PR-URL: https://github.com/nodejs/node/pull/33417 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Daniel Bevenius

commit sha ef1eb8d43903e7c5f671998cd3ee912a73292634

src: remove unused IsolateSettings variable PR-URL: https://github.com/nodejs/node/pull/33417 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Antoine du HAMEL

commit sha ca5f40f09e856ba09105a1e6918ac8d7a17735b3

doc: lint deprecation codes Add a rule to make sure deprecation codes are in order.

view details

push time in 12 days

pull request commentnodejs/node

doc: add package.json documentation

New changes PTAL:

  • I've moved "Self-referencing a package using its name" from esm.md to package.json.md – it's not a ESM-specific feature.
  • I've merged esm.md#Packages section into esm.md#Enabling. Given the content of the section, I think it makes more sense like this.

On master, the esm.md TOC look like this:

  • Introduction
  • Enabling
    • package.json "type" field
    • Package Scope and File Extensions
    • --input-type flag
  • Packages
    • Package Entry Points
      • Main Entry Point Export
      • Subpath Exports
      • Package Exports Fallbacks
      • Exports Sugar
      • Conditional Exports
      • Nested conditions
      • Self-referencing a package using its name
    • Dual CommonJS/ES Module Packages
      • Dual Package Hazard
        • Writing Dual Packages While Avoiding or Minimizing Hazards
          • Approach 1: Use an ES Module Wrapper
          • Approach 2: Isolate State
  • import Specifiers
    • Terminology
      • data: Imports
  • ...

On this PR it looks like this:

  • Introduction
  • Enabling
    • Package Scope and File Extensions
    • --input-type flag
    • Package Entry Points
    • Dual CommonJS/ES Module Packages
    • Dual Package Hazard
      • Writing Dual Packages While Avoiding or Minimizing Hazards
        • Approach 1: Use an ES Module Wrapper
        • Approach 2: Isolate State
  • import Specifiers
    • Terminology
      • data: Imports
  • ...
aduh95

comment created time in 13 days

push eventaduh95/node

Antoine du HAMEL

commit sha edbe6e439844a311dca37e1601b4e236198d38da

Move "Self-referencing a package using its name" from esm.md to package.json.md

view details

Antoine du HAMEL

commit sha 4a5d6f31b4667df0493a1b493ff7dd18fa312595

Merge `esm.md#Packages` section into `esm.md#Enabling`

view details

push time in 13 days

Pull request review commentnodejs/node

doc: add package.json documentation

+# `package.json`++<!--introduced_in=REPLACEME-->+<!-- type=misc -->++## Introduction++A `package.json` file defines a package scope: its parent directory, and all+subfolders below that folder down until the next folder containing another+`package.json`, is considered a _package scope_.++This document aims to describe the fields used by the Node.js+runtime. Other tools (E.G.:+[npm](https://docs.npmjs.com/creating-a-package-json-file)) may use additional+fields which are ignored by Node.js and not documented in this document.++## Supported fields++### `"name"`++```json+{+    "name": "package-name"+}+```++The `"name"` field defines your package’s name. Node.js doesn't apply any+restriction on the name field, although the field is ignored if it is not a+string or an empty string.++The `"name"` field can be used in addition to the [`"exports"`][] field to+[self-reference a package using its name][].++### `"exports"`++```json+{+    "exports": "./index.js"+}+```++The `"exports"` field provides an alternative to [`"main"`][] where the package+main entry point can be defined while also encapsulating the package, preventing+any other entry points besides those defined in `"exports"`. If package entry+points are defined in both [`"main"`][] and `"exports"`, the latter takes+precedence in versions of Node.js that support `"exports"`.+[Conditional Exports][] can also be used within `"exports"` to define different+package entry points per environment, including whether the package is+referenced via `require` or via `import`.++#### Subpath Exports++When using the `"exports"` field, custom subpaths can be defined along+with the main entry point by treating the main entry point as the+`"."` subpath:++```json+{+  "main": "./main.js",+  "exports": {+    ".": "./main.js",+    "./submodule": "./src/submodule.js"+  }+}+```++Now only the defined subpath in `"exports"` can be imported by a+consumer:++<!-- eslint-skip -->+```js+import submodule from 'es-module-package/submodule';+// Loads ./node_modules/es-module-package/src/submodule.js+```++While other subpaths will error:++<!-- eslint-skip -->+```js+import submodule from 'es-module-package/private-module.js';+// Throws ERR_PACKAGE_PATH_NOT_EXPORTED+```++Entire folders can also be mapped with package exports:++```json+// ./node_modules/es-module-package/package.json+{+  "exports": {+    "./features/": "./src/features/"+  }+}+```++With the above, all modules within the `./src/features/` folder+are exposed deeply to `import` and `require`:++<!-- eslint-skip -->+```js+import feature from 'es-module-package/features/x.js';+// Loads ./node_modules/es-module-package/src/features/x.js+```++When using folder mappings, every module contained within the+folder will be exposed. Any modules which are not public+should be moved to another folder to retain the encapsulation+benefits of exports.++#### Package Exports Fallbacks++For possible new specifier support in future, array fallbacks are+supported for all invalid specifiers:++```json+{+  "exports": {+    "./submodule": ["not:valid", "./submodule.js"]+  }+}+```++Since `"not:valid"` is not a valid specifier, `"./submodule.js"` is used+instead as the fallback, as if it were the only target.++#### Exports Sugar++If the `"."` export is the only export, the `"exports"` field provides sugar+for this case being the direct `"exports"` field value.++If the `"."` export has a fallback array or string value, then the `"exports"`+field can be set to this value directly.++```json+{+  "exports": {+    ".": "./main.js"+  }+}+```++can be written:++```json+{+  "exports": "./main.js"+}+```++#### Conditional Exports++Conditional exports provide a way to map to different paths depending on+certain conditions. They are supported for both CommonJS and ES module imports.++For example, a package that wants to provide different ES module exports for+`require()` and `import` can be written:++```json+// package.json+{+  "main": "./main-require.cjs",+  "exports": {+    "import": "./main-module.js",+    "require": "./main-require.cjs"+  },+  "type": "module"+}+```++Node.js supports the following conditions:++* `"import"` - matched when the package is loaded via `import` or+   `import()`. Can reference either an ES module or CommonJS file, as both+   `import` and `import()` can load either ES module or CommonJS sources.+* `"require"` - matched when the package is loaded via `require()`.+   As `require()` only supports CommonJS, the referenced file must be CommonJS.+* `"node"` - matched for any Node.js environment. Can be a CommonJS or ES+   module file. _This condition should always come after `"import"` or+   `"require"`._+* `"default"` - the generic fallback that will always match. Can be a CommonJS+   or ES module file. _This condition should always come last._++Condition matching is applied in object order from first to last within the+`"exports"` object. _The general rule is that conditions should be used+from most specific to least specific in object order._++Other conditions such as `"browser"`, `"electron"`, `"deno"`, `"react-native"`,+etc. are ignored by Node.js but may be used by other runtimes or tools.+Further restrictions, definitions or guidance on condition names may be+provided in the future.++Using the `"import"` and `"require"` conditions can lead to some hazards,+which are explained further in+[the dual CommonJS/ES module packages section][].++Conditional exports can also be extended to exports subpaths, for example:++```json+{+  "main": "./main.js",+  "exports": {+    ".": "./main.js",+    "./feature": {+      "browser": "./feature-browser.js",+      "default": "./feature.js"+    }+  }+}+```++Defines a package where `require('pkg/feature')` and `import 'pkg/feature'`+could provide different implementations between the browser and Node.js,+given third-party tool support for a `"browser"` condition.++#### Nested conditions++In addition to direct mappings, Node.js also supports nested condition objects.++For example, to define a package that only has dual mode entry points for+use in Node.js but not the browser:++```json+{+  "main": "./main.js",+  "exports": {+    "browser": "./feature-browser.mjs",+    "node": {+      "import": "./feature-node.mjs",+      "require": "./feature-node.cjs"+    }+  }+}+```++Conditions continue to be matched in order as with flat conditions. If+a nested conditional does not have any mapping it will continue checking+the remaining conditions of the parent condition. In this way nested+conditions behave analogously to nested JavaScript `if` statements.++### `"main"`++```json+{+    "main": "./main.js"+}+```++The `"main"` field defines the script that is used when the+current directory is required by another script.++```js+require('./path/to/directory'); // This resolves to ./path/to/directory/main.js.+```++This field is ignored when the [`"exports"`][] field is provided. The `"main"`+field is supported in all versions of Node.js, but its capabilities are limited:+it only defines the main entry point of the package.

TIL you can feed an absolute path to "main" and Node.js doesn't complain and load the script even if it's in a completely unrelated directory 🤯

Also worth noting that "main" takes a path and "exports" file URLs. I wasn't sure how to phrase it, so I just added Its value is interpreted as a path.. I'm open to better suggestions x)

aduh95

comment created time in 13 days

Pull request review commentnodejs/node

doc: add package.json documentation

+# `package.json`++<!--introduced_in=REPLACEME-->+<!-- type=misc -->++## Introduction++A `package.json` file defines a package scope: its parent directory, and all+subfolders below that folder down until the next folder containing another+`package.json`, is considered a _package scope_.++This document aims to describe the fields used by the Node.js+runtime. Other tools (E.G.:+[npm](https://docs.npmjs.com/creating-a-package-json-file)) may use additional+fields which are ignored by Node.js and not documented in this document.++## Supported fields++### `"name"`++```json+{+    "name": "package-name"+}+```++The `"name"` field defines your package’s name. Node.js doesn't apply any+restriction on the name field, although the field is ignored if it is not a+string or an empty string.++The `"name"` field can be used in addition to the [`"exports"`][] field to+[self-reference a package using its name][].++### `"exports"`++```json+{+    "exports": "./index.js"+}+```++The `"exports"` field provides an alternative to [`"main"`][] where the package+main entry point can be defined while also encapsulating the package, preventing+any other entry points besides those defined in `"exports"`. If package entry+points are defined in both [`"main"`][] and `"exports"`, the latter takes+precedence in versions of Node.js that support `"exports"`.+[Conditional Exports][] can also be used within `"exports"` to define different+package entry points per environment, including whether the package is+referenced via `require` or via `import`.

Good catch! I have added a line to explicitly state that "exports" expects file URL starting with ./ and "main" expects a path. I also added that "exports" takes precedence over "main" only when referencing a package by its name. PTAL.

aduh95

comment created time in 13 days

Pull request review commentnodejs/node

doc: add package.json documentation

 path `import feature from 'my-mod/feature/index.js`. #### Main Entry Point Export

I have moved this section to package.json.md based on your comment; I agree it was weird to split the topic, and it's not an ESM specific one.

aduh95

comment created time in 13 days

push eventaduh95/node

Antoine du Hamel

commit sha 6438ba9f706f2ac9ee837f939b920f54be1a2a07

Apply suggestions from code review Co-authored-by: Geoffrey Booth <GeoffreyBooth@users.noreply.github.com> Co-authored-by: Guy Bedford <guybedford@gmail.com>

view details

push time in 13 days

push eventaduh95/node

Antoine du Hamel

commit sha 7a5b8052f4aaea8c011fd766cb8104ef65171573

Apply suggestions from code review Co-authored-by: Geoffrey Booth <GeoffreyBooth@users.noreply.github.com> Co-authored-by: Guy Bedford <guybedford@gmail.com>

view details

push time in 13 days

Pull request review commentnodejs/node

doc: add package.json documentation

 or when referenced by `import` statements within ES module code:  * Files ending in `.cjs`. -* Files ending in `.js` when the nearest parent `package.json` file contains a-  top-level field `"type"` with a value of `"commonjs"`.+* Files ending in `.js` when the nearest parent [`package.json`][] file contains+  a top-level field [`"type"`][] with a value of `"commonjs"`.  * Strings passed in as an argument to `--eval` or `--print`, or piped to `node`   via `STDIN`, with the flag `--input-type=commonjs`. -### `package.json` `"type"` field--Files ending with `.js` will be loaded as ES modules when the nearest parent-`package.json` file contains a top-level field `"type"` with a value of-`"module"`.--The nearest parent `package.json` is defined as the first `package.json` found-when searching in the current folder, that folder’s parent, and so on up-until the root of the volume is reached.--<!-- eslint-skip -->-```js-// package.json-{-  "type": "module"-}-```--```sh-# In same folder as above package.json-node my-app.js # Runs as ES module-```--If the nearest parent `package.json` lacks a `"type"` field, or contains-`"type": "commonjs"`, `.js` files are treated as CommonJS. If the volume root is-reached and no `package.json` is found, Node.js defers to the default, a-`package.json` with no `"type"` field.--`import` statements of `.js` files are treated as ES modules if the nearest-parent `package.json` contains `"type": "module"`.--```js-// my-app.js, part of the same example as above-import './startup.js'; // Loaded as ES module because of package.json-```--Package authors should include the `"type"` field, even in packages where all-sources are CommonJS. Being explicit about the `type` of the package will-future-proof the package in case the default type of Node.js ever changes, and-it will also make things easier for build tools and loaders to determine how the-files in the package should be interpreted.--Regardless of the value of the `"type"` field, `.mjs` files are always treated-as ES modules and `.cjs` files are always treated as CommonJS.- ### Package Scope and File Extensions -A folder containing a `package.json` file, and all subfolders below that folder-down until the next folder containing another `package.json`, is considered a-_package scope_. The `"type"` field defines how `.js` files should be treated-within a particular `package.json` file’s package scope. Every package in a-project’s `node_modules` folder contains its own `package.json` file, so each-project’s dependencies have their own package scopes. A `package.json` lacking a-`"type"` field is treated as if it contained `"type": "commonjs"`.+Every package in a project’s `node_modules` folder usually contains its own+[`package.json`][] file, so each project’s dependencies have their own [package+scopes][]. A [`package.json`][] lacking a [`"type"`][] field is treated as if it

It's a little weird to jump straight to discussing node_modules subfolders without first introducing the concept of package scope. The only difference between this version and the old version is that the first two sentences have been removed, but those are pretty vital sentences that define what a package scope is.

Here are my thoughts on this topic. I can see 3 ways for handling it:

  1. Move the sentences to package.json.md#Introduction, and have a link in esm.md#Package Scope and File Extensions to the former.
  2. Keep the sentences in esm.md#Package Scope and File Extensions and add link(s) in package.json when package scope is mentioned.
  3. Duplicate the sentences.

The only one that makes sense to me is 1., and that's the one I have implemented in this PR. I have in mind that duplication is never a good thing and package scope doesn't belong to ESM. That being said, I'm open to being persuade otherwise.

Also do we want to linkify every mention of package.json and "type" etc.?

It was simply easier for me to do a search and replace, and it seemed tedious to me to decide which mention deserves a link, and which doesn't.

aduh95

comment created time in 13 days

more