#1010602 pkg-js-tools should run require test when node#exports#require is specified in package.json #1010602
- Package:
- pkg-js-tools
- Source:
- pkg-js-tools
- Submitter:
- Pirate Praveen
- Date:
- 2025-12-14 20:47:04 UTC
- Severity:
- normal
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"
},
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.
Hi, could you give me the repository link ?
Could you give me the link to a complete "exports" syntax ? It seems there are many ways to declare CJS files
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
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
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.