neutralinojs | lightweight cross-platform desktop application development | Runtime Evironment library
kandi X-RAY | neutralinojs Summary
kandi X-RAY | neutralinojs Summary
In Electron and NWjs, you have to install NodeJs and hundreds of dependency libraries. Embedded Chromium and Node make simple apps bloaty. Neutralinojs offers a lightweight and portable SDK which is an alternative for Electron and NW.js. Neutralinojs doesn't bundle Chromium and uses the existing web browser library in the operating system (Eg: gtk-webkit2 on Linux). Neutralinojs implements a WebSocket connection for native operations and embeds a static web server to serve the web content. Also, it offers a built-in JavaScript client library for developers. Ask questions on StackOverflow using tag neutralinojs.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of neutralinojs
neutralinojs Key Features
neutralinojs Examples and Code Snippets
Community Discussions
Trending Discussions on neutralinojs
QUESTION
I need to create a neutralino+svelte+ts project, I've noted it was possible in old version (neutralino-cli@1.8.1) but nothing similar is described in newest version of neutralino. I've tried to run in latest neutralino version the same command described in version 1.8.1
(neu create myapp --template svelte
) but I received the error:
neu: ERROR Unable to download resources from internet. Please check your internet connection and template URLs.
I've tried with different type of template (ts
and js
) and I had the same result.
I've tried also by running the command neu create myapp --template neutralinojs/neutralinojs-svelte
(same error).
Any idea how to do it?
...ANSWER
Answered 2022-Apr-02 at 07:35You can do it without any dedicated template, it's quite simple and easy.
Basically, you need to create a Neutralino app and a Svelte app side by side in the same root folder, then a little config to make them work together.
Detailed step by step :
Create a Neutralino app, following Neutralino documentation : https://neutralino.js.org/docs/getting-started/your-first-neutralinojs-app. Ensure you can run and build as in the tutorial.
In the root folder of your Neutralino application, rename
.gitignore
to.gitignore-neu
andreadme.md
toreadme-neu.md
In the Svelte REPL, download the zip file you want to start from, for example https://svelte.dev/repl/hello-world (click the download button on right side of the toolbar)
Copy the content of the zip file in your Neutralino root folder, so that Svelte
public
folder is at the same level as Neutralinoresources
folderRun
npm install
to setup the Svelte application. Ensure it works ok on its own by runningnpm run dev
andnpm run build
Now you have two standalone applications side by side in the same root folder. Let’s make them work together.
Merge Neutralino and Svelte .gitignore files by copying
.gitignore-neu
content into.gitignore
Open the file
/neutralino.config.json
and change"documentRoot":"/resources/"
to"documentRoot":"/public/"
so that Neutralino can use the Svelte outputOpen two console windows :
npm run dev
for Svelte andneu run
for Neutralino. You'll see a Neutralino native window displaying the Svelte home page.
You’re done !
Now you can code your Svelte web application in the /src
folder as you would for any Svelte application, with hot-compiling by Svelte and hot-reloading by Neutralino.
When your app is ready, build it with npm run build
(Svelte part) followed by neu build
(Neutralino).
If you need to use Neutralino API from within your Svelte code :
Copy the file
/resources/js/neutralino.js
to the/public/
folderadd the line
to the
block of
/public/index.html
(right after the line)
Add
Neutralino.init();
in Svelte main.js file (/src/main.js
)
If you need Typescript, install a Neutralino Typescript app at step 1, and run Svelte Typescript setup script after the step 5.
QUESTION
I'm new in NeutralinoJS, I'm trying my first app and I need to read the content of a json file. I'm trying by using Neutralino.filesystem.readFile
method, but it fails with error
ANSWER
Answered 2022-Mar-30 at 19:11I was actually just coming across this same problem. Make sure in your neutralino.config.json
you have filesystem.*
in your nativeAllowList
section like so:
QUESTION
I have a neutralinojs app with an file input. It should only be possible to choose files from type ".csv" or ".xlsx". So I use the accept attribute.
That works in browser mode but not in window mode.
Is there a workaround to show only files with these filetypes in the file chooser?
...ANSWER
Answered 2022-Jan-23 at 15:39You Need To Use Neutralino's API For Dialogs.
So In Neutralino's OS API We Have Some Functions For save file
, open file
and open folder
using which we can show dialogs to users.
In your case you need to use open file
dialog so you can use Neutralino.os.showOpenDialog
, example:
QUESTION
In my Neutralino app I have a navigation. When I click on a specific navigation item, I want a local html to open in the browser (or new window). The html file to open is in a subfolder of my app resources directory.
My first approach was to call the relative URL in the main.js file via Neutralino.app.open (in my config.json "url" is set to "/resources/"), without success.
...ANSWER
Answered 2021-Aug-02 at 11:58I have found an answer myself.
In Neutralino there is a global variable NL_CWD
that contains the app path. With that path I can directly open the local html file in browser via file:/// ...
The solution:
QUESTION
I tried to create my first NeutralinoJS app using neu-cli. I typed neu create --template hello-world
command in Windows Command Prompt as in the doucmentation. But it gives me this error.
error: missing required argument 'name'
So I typed it again in git bash. But it gives the same error again. How to fix this ? Any idea ?
...ANSWER
Answered 2021-Feb-19 at 16:20I found the solution. Command syntax is like this :
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install neutralinojs
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page