Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/customerio/devices
Utility to map device models to marketing friendly device name.
https://github.com/customerio/devices
android device hacktoberfest ios utility
Last synced: 16 days ago
JSON representation
Utility to map device models to marketing friendly device name.
- Host: GitHub
- URL: https://github.com/customerio/devices
- Owner: customerio
- License: mit
- Created: 2022-09-15T01:40:15.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-06T07:24:04.000Z (about 1 month ago)
- Last Synced: 2025-01-22T22:55:15.707Z (16 days ago)
- Topics: android, device, hacktoberfest, ios, utility
- Language: Go
- Homepage: https://www.npmjs.com/package/@customerio/devices
- Size: 7.2 MB
- Stars: 1
- Watchers: 9
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @customerio/devices
Utility to map device models to marketing friendly device name. The android list is pretty huge, and we've decided to cater to the most popular brands based on [market share](https://www.appbrain.com/stats/top-manufacturers). If you need a device that isn't in the list, please open an issue or a PR.
## Installation
```bash
npm i --save @customerio/devices
```## Usage
```ts
import { getMarketingName } from '@customerio/devices';console.log(getMarketingName('iPhone14,2'));
```
Output:```bash
iPhone 13 Pro
```## Development
#### How to generate android devices json?
Simple golang script fetches data from https://storage.googleapis.com/play_public/supported_devices.html and generates json file.
```bash
cd scripts/android
go run main.go
```TODO
#### How to generate ios devices json?
- Manually maintained 🤓 from https://www.theiphonewiki.com/wiki/Models for Apple TV, Watch, iPads and iPhones.
## Size details
[Size Limit](https://github.com/ai/size-limit) controls the size.
Small Libraries```bash
$ npm run build && npm run size✔ Adding to empty webpack project
✔ Running JS in headless Chrome
Time limit: 3 s
Size: 90.16 kB with all dependencies, minified and gzipped
Loading time: 1.8 s on slow 3G
Running time: 266 ms on Snapdragon 410
Total time: 2.1 s```
## Todo
- [ ] Protect main branch from direct commits
- [ ] Add a PR template
- [ ] Add development instructions
- [ ] Automate iOS data collection (far fetched)