samsung-device-helper
TypeScript icon, indicating that this package has built-in type declarations

0.0.9 • Public • Published

Samsung Device Helper

samsung-device-helper is an npm package designed to provide a comprehensive list of Samsung devices, including phones, tablets, and watches. The package offers utility functions to retrieve device names by model and fetch lists of devices by category. Note: the list of phones includes models released after 2017, ensuring up-to-date information on the latest Samsung phones.

Installation

To install the package, run:

npm install samsung-device-helper

Usage

Here's a quick guide on how to use the samsung-device-helper package in your project.

Importing the Package

First, import the necessary functions from the package:

const {
  getNameByModel,
  getAllSamsungPhones,
  getAllSamsungTablets,
  getAllSamsungWatches,
  getAllSamsungDevices,
} = require("samsung-device-helper");

Functions

getNameByModel(model: string): string

This function takes a device model as an argument and returns the corresponding device name. If the model is not recognized, it returns the model itself.

const deviceName = getNameByModel("SM-G991B");
console.log(deviceName); // Outputs: "Galaxy S21 5G"

getAllSamsungPhones(): Device[]

Returns an array of all Samsung phones.

const phones = getAllSamsungPhones();
console.log(phones);

getAllSamsungTablets(): Device[]

Returns an array of all Samsung tablets.

const tablets = getAllSamsungTablets();
console.log(tablets);

getAllSamsungWatches(): Device[]

Returns an array of all Samsung watches.

const watches = getAllSamsungWatches();
console.log(watches);

getAllSamsungDevices(): Device[]

Returns an array of all Samsung devices, including phones, tablets, and watches.

const devices = getAllSamsungDevices();
console.log(devices);

Contributing

If you'd like to contribute to this project, please submit a pull request or open an issue on GitHub.

License

This project is licensed under the MIT License.


For more information, visit the GitHub repository.

Acknowledgments

This package is inspired by the need to simplify the retrieval and management of Samsung device data for developers.

Happy coding!

Package Sidebar

Install

npm i samsung-device-helper

Weekly Downloads

29

Version

0.0.9

License

MIT

Unpacked Size

74.8 kB

Total Files

14

Last publish

Collaborators

  • kulcsarrudolf