Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
287 views
in Technique[技术] by (71.8m points)

sapper - 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

question from:https://stackoverflow.com/questions/66062687/how-can-i-use-systeminformation-in-svelte

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...