Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter is not under sufficient condition #8

Closed
loynoir opened this issue Aug 1, 2021 · 1 comment
Closed

Parameter is not under sufficient condition #8

loynoir opened this issue Aug 1, 2021 · 1 comment

Comments

@loynoir
Copy link

loynoir commented Aug 1, 2021

Proposal

is-builtin-module(name:string, runtime?:TRuntime)
interface TRuntime {
  version?: string,
  module?: "import" | "require",
  name?: "node" | "deno",
}

Motivation

stream/web is experiment but builtin module in node16 but not in node14.

$ docker run -it node:16
> require('stream/web').ReadableStream
[class ReadableStream]

$ docker run -it node:14
> require('stream/web').ReadableStream
Uncaught Error: Cannot find module 'stream/web'

And maybe there is or will be some modules

  1. maybe: builtin for require but not for import
  2. maybe: builtin for import but not for require

Besides, maybe good for if support deno runtime in the future.

@sindresorhus
Copy link
Owner

I don't have any plans to any of this. If you need it, I suggest making a new package. I prefer to keep this one simple and focused on the 95% use-case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants