https://github.com/idimetrix/mobile-or-tablet
Determines if the device is either a mobile phone or a tablet.
https://github.com/idimetrix/mobile-or-tablet
Last synced: 6 months ago
JSON representation
Determines if the device is either a mobile phone or a tablet.
- Host: GitHub
- URL: https://github.com/idimetrix/mobile-or-tablet
- Owner: idimetrix
- License: other
- Created: 2024-09-25T20:54:34.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-09-25T20:56:45.000Z (8 months ago)
- Last Synced: 2024-11-07T08:19:12.734Z (7 months ago)
- Language: TypeScript
- Size: 65.4 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# **mobile-or-tablet**
Determines if the device is either a mobile phone or a tablet.
## Installation
You can install the package using **npm**, **yarn**, or **pnpm**.
```bash
pnpm add mobile-or-tabletyarn install mobile-or-tablet
npm install mobile-or-tablet
```## Usage
```tsx
import { isMobile, isMobileOrTablet, isTablet } from "mobile-or-tablet";if (isMobile()) {
/* is Mobile */
}
if (isMobileOrTablet()) {
/* is Mobile Or Tablet */
}
if (isTablet()) {
/* is Tablet */
}
```## tsup
Bundle your TypeScript library with no config, powered by esbuild.
https://tsup.egoist.dev/
## How to use this
1. install dependencies
```
# pnpm
$ pnpm install# yarn
$ yarn install# npm
$ npm install
```2. Add your code to `src`
3. Add export statement to `src/index.ts`
4. Test build command to build `src`.
Once the command works properly, you will see `dist` folder.```zsh
# pnpm
$ pnpm run build# yarn
$ yarn run build# npm
$ npm run build
```5. Publish your package
```zsh
$ npm publish
```## test package
https://www.npmjs.com/package/mobile-or-tablet