https://github.com/max-programming/use-os
Parses browser user-agent strings for React
https://github.com/max-programming/use-os
Last synced: 3 months ago
JSON representation
Parses browser user-agent strings for React
- Host: GitHub
- URL: https://github.com/max-programming/use-os
- Owner: max-programming
- Created: 2021-06-19T12:37:41.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-05-28T17:04:41.000Z (about 4 years ago)
- Last Synced: 2025-02-09T17:31:00.062Z (4 months ago)
- Homepage: https://www.npmjs.com/package/use-os
- Size: 109 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![]()
:package: use-os
Parses browser user-agent strings for React
Did you like the project? Please, considerate being a supporter and receive exclusive gifts!
## Installation
> Clone this repository: `git clone https://github.com/hebertcisco/use-os`
### Open the directory and install the dependencies
```bash
cd use-os
npm install
```## Using
```js
import useOs from "use-os";
```In react component:
```js
export default function HomePage() {
const os = useOs();return (
{os === "windows" ? (
<>
Windows (.exe)
>
) : (
<>>
)}
);
}
```