Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ryuapp/is-windows
https://github.com/ryuapp/is-windows
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/ryuapp/is-windows
- Owner: ryuapp
- Created: 2024-12-14T13:20:19.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-12-15T05:30:29.000Z (about 1 month ago)
- Last Synced: 2024-12-15T06:23:36.020Z (about 1 month ago)
- Language: TypeScript
- Size: 0 Bytes
- 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.## 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"));
```