https://github.com/ryuapp/is-windows
Returns true if the current platform is Windows
https://github.com/ryuapp/is-windows
Last synced: about 1 year ago
JSON representation
Returns true if the current platform is Windows
- Host: GitHub
- URL: https://github.com/ryuapp/is-windows
- Owner: ryuapp
- License: mit
- Created: 2024-12-14T13:20:19.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-23T16:45:46.000Z (over 1 year ago)
- Last Synced: 2025-04-02T05:54:15.247Z (about 1 year ago)
- Language: TypeScript
- Homepage: https://jsr.io/@ryu/is-windows
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.
```ts
import { isWindows } from "@ryu/is-windows";
console.log(isWindows());
```
## 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"));
```