Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ryuapp/is-windows


https://github.com/ryuapp/is-windows

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# is-windows

Returns true if the current platform is Windows. It works with multiple
JavaScript runtimes(Deno, Node.js, Bun) and browsers.

## Recipes

We can easily identify Windows without using this library.

### Deno

```ts
console.log(Deno.build.os === "windows");
```

### Node.js, Bun

```ts
console.log(process.platform === "win32");
```

## Browser

```ts
console.log(window.navigator.userAgent.includes("Windows"));
```