📦 use-os
Parses browser user-agent strings for React
Did you like the project? Please, considerate being a supporter and receive exclusive gifts!
Installation
Using NPM:
# Using NPM
npm install --save use-os
Using PNPM:
# Using PNPM
pnpm add use-os
Using YARN:
# Using YARN
yarn add use-os
Using
import useOs from 'use-os';
In react component:
export default function HomePage() {
const os = useOs();
return (
<div>
{os === 'windows' ? (
<>
<b>Windows</b> (.exe)
</>
) : (
<></>
)}
</div>
);
}
Contribute
Clone this repository:
git clone https://github.com/hebertcisco/use-os
Open the directory and install the dependencies
cd use-os
npm install
🤝 Contributing
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Show your support
Give a ⭐️ if this project helped you!
Or buy me a coffee 🙌🏾
📝 License
Copyright © 2022 Hebert F Barros.
This project is MIT licensed.