-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat: detect the underlying runtime #66
Conversation
Codecov Report
@@ Coverage Diff @@
## main #66 +/- ##
==========================================
+ Coverage 82.88% 86.02% +3.13%
==========================================
Files 6 7 +1
Lines 263 322 +59
Branches 25 29 +4
==========================================
+ Hits 218 277 +59
Misses 42 42
Partials 3 3
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks π―
(I made some small changes hope you are happy with them)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i forgot to press "submit review"
oops
// https://nodejs.org/api/process.html#processrelease | ||
export const isLagon = !!globalThis.__lagon__; | ||
export const isNode = globalThis.process?.release?.name === "node"; | ||
export const isBun = globalThis.process?.release?.name === "bun"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i could be mistaken but i believe we updated this property to be "node" due to a compatibility fix of an old package.
use !!globalThis.bun or !!process.versions.bun
π Linked issue
#65
β Type of change
π Description
Port from https://github.com/QuiiBz/detect-runtime to add a new
detectRuntime()
function, and newisNode
,isDeno
, andisBun
flags.The list of runtime keys is currently limited to
workerd
,deno
,lagon
,netlify
,node
,bun
,edge-light
, andfastly
becauseelectron
,react-native
, andedge-routine
are not easily detectable.This PR also updates the Provider Detection section of the README to use the correct
provider
andproviderInfo
variables (instead ofplatform
andplatformInfo
)π Checklist