#1010602 pkg-js-tools should run require test when node#exports#require is specified in package.json

#1010602#5
Date:
2022-05-05 09:53:44 UTC
From:
To:
An example is istextorbinary module it has both esm and cjs versions
and so require test should not be skipped even though type: module is
present.

  "type": "module",
  "main": "edition-es2019/index.js",
  "exports": {
    "node": {
      "import": "./edition-es2019-esm/index.js",
      "require": "./edition-es2019/index.js"
    },

#1010602#10
Date:
2022-05-05 13:49:12 UTC
From:
To:
On വ്യാ, മേയ് 5 2022 at 03:46:30 വൈകു +0200 +0200, Yadd <yadd@debian.org> wrote:

This is a new package and I need some more work before I can push it.
For now you can just try with npm2deb create istextorbinary I think.

#1010602#15
Date:
2022-05-05 13:46:30 UTC
From:
To:
Hi,

could you give me the repository link ?

#1010602#20
Date:
2022-05-05 13:54:04 UTC
From:
To:
Could you give me the link to a complete "exports" syntax ? It seems
there are many ways to declare CJS files

#1010602#25
Date:
2022-05-05 14:21:16 UTC
From:
To:
On വ്യാ, മേയ് 5 2022 at 03:54:04 വൈകു +0200 +0200, Yadd <yadd@debian.org> wrote:

This is the official documentation for conditional exports syntax

https://nodejs.org/api/packages.html#conditional-exports

#1010602#30
Date:
2022-05-05 14:51:21 UTC
From:
To:
Le jeu. 5 mai 2022 à 15:57, Yadd <yadd@debian.org> a écrit :

I may have skipped that part when I explained this to you :)
See
file:///usr/share/doc/nodejs/api/packages.html#conditional-exports

#1010602#35
Date:
2025-12-14 20:44:57 UTC
From:
To:
Example of one case where we don't want require to be tested:

node-luxon/types-luxon/package.json

    "main": "",
    "types": "index.d.ts",
    "exports": {
        ".": {
            "import": "./index.d.mts",
            "require": "./index.d.ts"
        },
        "./package.json": "./package.json"
    },

the package.json#type field isn't defined.