#1008061 node-builtins: Returns a wrong list of builtins module

#1008061#5
Date:
2022-03-21 17:15:47 UTC
From:
To:
Hi,

node-builtins returns a static modules list which is up-to date for
Node.js < 11. It should be patched to use node-builtin-modules result
for node.js >= 12

#1008061#10
Date:
2022-03-21 17:53:38 UTC
From:
To:
Comparison:

$ node
 > require("builtins")()
[
   'assert',         'buffer',      'child_process',
   'cluster',        'console',     'constants',
   'crypto',         'dgram',       'dns',
   'domain',         'events',      'fs',
   'http',           'https',       'module',
   'net',            'os',          'path',
   'punycode',       'querystring', 'readline',
   'repl',           'stream',      'string_decoder',
   'sys',            'timers',      'tls',
   'tty',            'url',         'util',
   'vm',             'zlib',        'v8',
   'process',        'inspector',   'async_hooks',
   'http2',          'perf_hooks',  'trace_events',
   'worker_threads'
]
 > require("builtin-modules")
[
   'assert',        'async_hooks',    'buffer',
   'child_process', 'cluster',        'console',
   'constants',     'crypto',         'dgram',
   'dns',           'domain',         'events',
   'fs',            'http',           'http2',
   'https',         'inspector',      'module',
   'net',           'os',             'path',
   'perf_hooks',    'process',        'punycode',
   'querystring',   'readline',       'repl',
   'stream',        'string_decoder', 'timers',
   'tls',           'trace_events',   'tty',
   'url',           'util',           'v8',
   'vm',            'wasi',           'worker_threads',
   'zlib'
]

#1008061#15
Date:
2022-03-21 18:04:24 UTC
From:
To:
Good catch,
do you want me to do it ?

Jérémy

#1008061#20
Date:
2022-03-21 19:01:09 UTC
From:
To:
Le 21 mars 2022 19:04:24 GMT+01:00, "Jérémy Lal" <kapouer@melix.org> a écrit :

Yes, thanks !

#1008061#25
Date:
2022-03-21 20:49:30 UTC
From:
To:

Suggested approach would break the module API:

require('builtins')({ version: '6.0.0' })
require('builtins')({ version: '6.0.0', experimental: true })

it's supposed to be queryable.

I'd rather fix the list.

Jérémy