Search code examples
sveltesapper

How can I use systeminformation in Svelte?


So, I'm learning svelte + sapper, and I want to use systeminformation to retrieve detailed hardware, system and OS information.

I installed it with ' npm i systeminformation ' and it shows on node_modules, but I don't know how to use/require/import it. For example, I want to see my cpu information, but I don't know how to use it on my .svelte file.

This is what I want to use:
https://www.npmjs.com/package/systeminformation
https://systeminformation.io/gettingstarted.html

I'm so sorry if this is a really noob question, and thank you so much for any help in advance!!! Also, english is not my main language, so... sorry if i could not express my doubt properly.
Thank you again! :D


Solution

  • Check svelte-adaptive-sensors which export stores for system info.

    From the readme :

    Sensors to help you deliver adaptive sensors to users depending on their network-type, memory, cpu, and saveData settings. A svelte version of react-adaptive-hooks although there are very few differences between the two libraries currently.