use-os
TypeScript icon, indicating that this package has built-in type declarations

1.0.10 • Public • Published

:package: use-os

📦 use-os

Parses browser user-agent strings for React

Did you like the project? Please, considerate being a supporter and receive exclusive gifts!

codecov

Node.js build and publish package

Running Code Coverage

TypeScript React.js Free. Built on open source. Runs everywhere. GitHub Actions

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.

Package Sidebar

Install

npm i use-os

Weekly Downloads

4

Version

1.0.10

License

MIT

Unpacked Size

7.73 kB

Total Files

9

Last publish

Collaborators

  • tecnobert