How to get the system information in Electron? - system

I need to get the system info on the multi platforms in Electron. How to get the system information in Electron?

Check out this page https://nodejs.org/api/os.html. It is nodejs documentation, but since electron and node are very much the same thing it will work.
var os = require('os');
is what you are looking for though.

Related

Given an npm package, how do I know whether it will work in browser?

I've recently installed some npm package (recommended Kubernetes client) for my react app.
After writing code that uses the package and deploying the code for testing I got some weird errors about missing functions or packages. Then I've read the documentation and realized that the package was Node-only.
Is there any way to check that the npm package works in browser before writing code that uses the package?
Python packages specify compatible python versions. Do npm packages have something like this whether they indicate support for particular Node versions and the browsers?
Some packages/libraries contain .browserlistrc file which I've found to be a starting point to find out the browsers and platforms the devs intend to support or have their code compile for. While it may not always be true and the package might just be able to support a browser that isn't mentioned, it's a good starting point. It surely helps to find out if IE (the bane of front-end dev) is supported or not.
Then again many packages don't necessarily include a .browserlistrc. You can then check the package.json for a "browserslist" field.
If neither are found, you can always clone the repo and add your own .browserlistrc in the root with queries that will let you know if the package supports your intended browser or platform - little more work but yeah it can help. Not full proof but a decent enough way to find out.
Though the best answer is really to just ask the maintainers.

neutralinojs and Blazor in Linux

I try some platform to create Linux Desktop application with Blazor (Including ElectronNET), but in most case its empty self advertising without really opportunity to do even simplest task.
Therefore I'm still in searching a good platform to make desktop apps in Linux with Blazor.
Is neutralinojs good fit to this task including development in VS CODE and deployment to end-user?
Neutralinojs is a lot like Electron. The main difference being that Neutralinojs does not use npm or is based on chromium.
This makes Neutralinojs faster than Electron. If you desire to make desktop apps with HTML, CSS, or JS then Neutralinojs would be a good fit for you!
I have tried both and I can tell you that Neutralinojs is the best at a quick startup.
Neutralinojs will work great with any code editor. You can even use the terminal that VS Code provides.
After you finish writing the code for your project, you can run the build command. This command will make executables for any OS including Linux.

How to distribute a desktop app built with Electron, Node.js and Python

I have recently built a desktop app using Electron and Express.js, and I also used python-shell in Node.js to call a python module. Specifically, the Express server will call the python module which sends SQL queries to Impala, and get the query result from it, then transmit it to the front-end.
It works well, but I wonder how to distribute this app? Obviously the python-shell module is not applicable without python environment. Any suggestions? Thank you all!
As far as I can see you have two possibilities:
Distribute a Python Installer along your Installation
Port your Python module to a native executable, native node module, or plain JS in the Electron app itself.

How to run dart spark on my own computer?

I see there is a project named spark, which is a Chrome app based development environment.
It seems interesting, and I want to run it my own computer(mac os), expected to see a chrome-based IDE for dart. But I can't find any document to tell me how to run it. There are just some pages for how to develop and test, but how to run it?
I tried with the grind shell with all kinds of options, but no lucky :(
Thanks for the question! The Spark effort is still spinning up, and we're not yet ready for a public release. All the source code is available publicly, so it is possible for people to build it for themselves. Once we're further along we'll put a developer preview release up on the chrome web store.
The steps to build & run Spark IDE on Windows are:
Install Dart SDK to e.g. C:\dart-sdk
Download the Spark source code to e.g. C:\spark
Open cmd and type: cd C:\Spark
set PATH=%PATH%;C:\dart-sdk\bin
set DART_SDK=C:\dart-sdk
pub get
grind.cmd deploy
Load the upacked extension from C:\Spark\ide\build\deploy-out\web in Chrome Dev.
Alternatively, you can download Chrome Dev Editor packaged app, based on Spark 0.13,

When I use a KRL module do I get the deployed version?

Does importing a module get the deployed version in KRL? Suppose I want to use the development version, can I get that instead?
You will currently get the same version as the app you are running. We will be making a few small changes to this behavior to make it more clear and provide more options.