Como usar nw.js8/31/2023 ![]() ![]() We're going to put it into a, just a run.sh.Actually, what am I doing? Let's echo into run.sh. We're going to go ahead and take this command. ![]() What we can do real quick, I like to actually make a shortcut with this command here. It's not giving you an error, because there's no.It could found the package JSON, but it doesn't have anything to run. Now, if we run the app, go back up to this, you'll see that it's referencing nothing. Now, we'll have a package JSON file in here that looks a little something like this. The rest of these I believe you can just go with the defaults. We're going to actually make the entry point index.html, not index.js. We're just going to go ahead and call this NWJS, all caps, just to make it easy. What we can do is either just create a package JSON on our own or use npm-init to create one for us. We're just going to go ahead and close this. NW.js relies on a package JSON to know where the entry point for your app is. If we do that now, we'll find that it has an invalid package, because there's no package JSON. With this, we can run it on the current directory and actually see the app in action. Then inside of this the binary is called NWjs. This is the standard sort of thing where the apps live inside of Mac Apps. That app file is actually called NWjs.app, and inside of that you get contents, and then you get Mac OS, which is a standard. Then once you're inside of that, with OS X you get an app file, which is actually a directory that holds the binary. I downloaded it to my downloads directory and the ZIP directory is right here. With that binary, we can actually create our app. You unzip the file and it gives you a binary. I'm using OS X, so I already downloaded this right here at the bottom. They have a bunch of different binaries to develop with. It's not for mobile, but you can actually code sign the apps and distribute them amongst app stores, so it's really great for desktop development, especially when you want to go across OSes. I've had great success with it, I love it. Basically what it is is they've given you an instance of Chromium and a way to package Chromium onto various OSes to create cross-platform apps, and it works really well. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |