awslabs / llrt

LLRT (Low Latency Runtime) is an experimental, lightweight JavaScript runtime designed to address the growing demand for fast and efficient Serverless applications.
Apache License 2.0
7.74k stars 342 forks source link

Will more node modules be supported? #438

Open ahaoboy opened 5 days ago

ahaoboy commented 5 days ago

For some commonly used third-party libraries, they need to rely on some modules that llrt does not currently support in order to run

undici

'node:assert',
'node:http',
'node:stream',
'node:net',
'node:buffer',
'node:util',
'node:querystring',
'node:events',
'node:zlib',
'node:perf_hooks',
'node:util/types',
'node:crypto',
'node:diagnostics_channel',
'node:tls',
'node:http2'

inquirer

'os', 
'tty',
'stream', 
'node:async_hooks',
'node:readline' 

These modules do not seem to be necessary for the use of llrt, such as readline and tty modules, so it seems that the best solution is to collect these common modules together? https://github.com/awslabs/llrt/issues/430 These libraries only use some simple APIs. Will llrt accept PRs to add these modules?

richarddavison commented 3 days ago

Hi @ahaoboy.

Undici would make little sense in LLRT as the http client we’re supporting is fetch and uses a native implementation in Rust. Undici is also very node specific.

Similarly inquirier depends on readline and standard input which is not supported (unless reading from /dev/stdin). This is because LLRT is mainly built for serverless and ephemeral environments where stdin is not commonly used.