Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@athenna/common",
"version": "5.25.0",
"version": "5.26.0",
"description": "The Athenna common helpers to use in any Node.js ESM project.",
"license": "MIT",
"author": "João Lenon <[email protected]>",
Expand Down
16 changes: 16 additions & 0 deletions src/helpers/Is.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,22 @@ export class Is extends Macroable {
return kind
}

/**
* Verify if the current runtime is Node.
*/
public static Node(): boolean {
return typeof process !== 'undefined' && process.versions?.node !== null
}

/**
* Verify if the current runtime is Deno.
*/
public static Deno(): boolean {
// eslint-disable-next-line
// @ts-ignore
return typeof Deno !== 'undefined' && Deno.version !== null
}

/**
* Verify if the current platform is Linux.
*/
Expand Down