2.0.0 ā€¢ Published 2 years ago

@customerio/devices v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@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. If you need a device that isn't in the list, please open an issue or a PR.

Installation

npm i --save @customerio/devices

Usage

import { getMarketingName, Platform } from '@customerio/devices';

console.log(getMarketingName('iPhone14,2', Platform.IOS));

Output:

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.

cd scripts/android
go run main.go

TODO

How to generate ios devices json?

Size details

Size Limit controls the size. Small Libraries

$ 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)
1.2.0

2 years ago

2.0.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.2.0

2 years ago

0.1.2

2 years ago

0.0.1

2 years ago