Kebab file names

This commit is contained in:
Angelos Chalaris
2023-04-27 21:58:35 +03:00
parent 1d189c709a
commit 61200d90c4
440 changed files with 0 additions and 0 deletions

24
snippets/is-node.md Normal file
View File

@ -0,0 +1,24 @@
---
title: Environment is Node.js
tags: node
cover: cloudy-rock-formation
firstSeen: 2020-10-12T20:01:21+03:00
lastUpdated: 2021-04-02T11:45:13+03:00
---
Determines if the current runtime environment is Node.js.
- Use the `process` global object that provides information about the current Node.js process.
- Check if `process`, `process.versions` and `process.versions.node` are defined.
```js
const isNode = () =>
typeof process !== 'undefined' &&
!!process.versions &&
!!process.versions.node;
```
```js
isNode(); // true (Node)
isNode(); // false (browser)
```