What are uv and v8 in nodeJS - node.js

There are 2 directories uv and v8 in deps folder
First question : what is the definition of deps directory?
My second question: What are uv and v8 utilities in Node.js?

To add a bit more detail:
libuv is a library for asynchronous I/O, originally developed for Node.js, and by now also used by a number of other projects. See https://github.com/libuv/libuv.
V8 is the JavaScript engine that powers Google Chrome, other Chromium-derived browsers (Opera, Yandex Browser, the Android versions of Firefox Focus and Microsoft Edge, and a bunch of others), CEF-derived desktop software (GitHub's Atom, Microsoft's Visual Studio Code, Valve's Steam, and others), Node.js, and many other embedding applications. See https://developers.google.com/v8/.

deps or dependencies: that contains things that are built outside of nodejs but are a part of node js.
UV and V8 are C++ dependencies for node JS

Related

Trying to understand "Since Electron is very likely to use a different V8 version" explanation

Electron Documentation page Using Native Node Modules includes the following explanation:
Native Node modules are supported by Electron, but since Electron is
very likely to use a different V8 version from the Node binary
installed on your system, the modules you use will need to be
recompiled for Electron.
As an Electron newbie, I know about the main Node.js process and the renderer processes, but the above explanation still makes no sense to me. An explanation of what the above is saying, and why one needs to worry about V8, would be welcome.
Note that this is talking about "native node modules" which I assume means modules that use some "native code" and use the add-on library interface in order to extend node.js with native code.
Electron packages a specific built of node.js in it's build tools. Some modules you use (like the ones that are not 100% javascript, that include some native code) may need to be "built" for the specific version of node.js that you're running.
So, all they're saying is that if you're running node v12.13.1 on your development computer, but the version of electron you're using has v10.x in it, then if you have some modules you're using that have native code in them, you may need to rebuild them for the version of V8 built into your electron environment. This wouldn't be so much because of the variations in the Javascript engine (those aren't usually dealt with by compiling), but because of variations in the add-on library that "native code" modules use.

JXcore vs Electron

question
I am wondering what the main differences are between Electron and JXcore.
background
I was thinking about how I could make a NodeJS server into an app and I came across both of these. They seem to do the same thing, except that JXcore supports mobile and Electron doesn't.
side question
If Electron doesn't support mobile then how was the slack mobile app created?
Thanks in advance!
From the JXCore site(http://jxcore.com/tech/):
JXcore is a fork on the open source Node.js project
It uses LLVM to compile javascript as opposed to V8 which NodeJS does.
In terms of what are the main differences- Electron is a framework for building native, cross platform desktop applications, where it appears JXCore is a javascript engine forked from NodeJS.
Electron is built with NodeJS, and Chromium. So to make it fair, the comparison would be better stated "How does Electron work with NodeJS vs JXcore". Since I don't have any experience with JXCore, I can't answer that question. I would venture to say the only way to know that is to fork electron and replace Node with JXCore.
Based on your background, I would assume you are thinking about making one application that works cross platform across mobile and desktop environments. To that, I would say it is possible, but you are going to have 2 different projects. There are things in Electron that you wouldn't want included in your mobile app, since they are working with completely different operating systems. You are right that electron does not support mobile (it wasn't built for that).
As far as your side question goes, there are any number of technologies that slack could have used to create their mobile app. They could have used Java , Swift, Objective-C, .NET, Ruby, or Javascript.
There are cross platform tools such as RubyMotion, NativeScript, React Native, and Xamarin that could also be used to create native mobile apps, that all compile down into the native language the mobile OS understands.
A final approach could be the use of tools such as Cordova/Phonegap which create mobile apps via a "web view". Essentially, this is like creating an app that launches a web browser to interact with your phone.
If you are looking for an example on how to build once and use everywhere, I would look at the github repo found here https://github.com/NathanWalker/angular-seed-advanced. This shows a common codebase that can be used in Electron, Web, and Mobile.

Node.js runtime wrapper

Are there any node.js runtime wrappers generators similar to gradle wrapper that allows to build node.js application without installing the node runtime globally?
Yes, there are many projects that aim to make bundling Node.js with your apps easy:
node-bundler
Nexe (doesn't support dynamic require statements)
EncloseJS (paid)
If you're starting a GUI project from scratch, then Electron or NW.js allow you to bundle up a browser with your app to allow using JS, HTML and CSS.
There are also some experimental JavaScript-to-uninterpreted compilers in the work:
ts2c converts TypeScript to C which can then be compiled with gcc or clang, and there's an unreleased project called Nectar that aims to compile JS to machine code directly.

Relation between Node.js and FireFox

I knew that node.js based on V8 Javascript engine of Google Chrome.
And I want to know If Node.js can run on FireFox ,then how?
What version of firefox support V8 javascript Engine or Node.js?
You are mixing up JS Engine and browser.
V8 is the JS Engine of Google Chrome (also used by Chromium, MongoDB among others).
SpiderMonkey is the JS Engine of Firefox (also used by GNOME and Adobe as examples).
Chakra is Microsoft's JS Engine, by Internet Explorer, old Edge (new one is Chromium based, and as such use V8) and some other Microsoft projects.
Node.js is based on V8, which you confuse with Google Chrome. They use the same JS Engine, but you don't need any part of Chrome itself to use Node.js.
There has been project to port node.js to SpiderMonkey, like SpiderNode or JXcore, but aren't actively developed anymore.
On the other side, Microsoft had worked on making node-chakracore. It has been archived at the end of 2019. It even had some really interesting options on it (Reverse Time Travel for example).

IDE and Debugger for node.js [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I am going to start building project in node.js (was working in PHP before), What is the IDE, Debugger and Helping Tools for node.js, to help improvement while coding ?
There are several IDEs which support Node.js natively:
Desktop-based IDEs
WebStorm - popular and extremely powerful IDE for coding web applications. $100 for commercial license, $50 personal, $25 academic, free for open source developers upon application approval. Can also debug Meteor.JS applications.
Komodo IDE
Cloud9 Local - You can install a local copy of cloud9 on desktop as well and work on a local directory as workspace, follow the instructions on github page. Be sure to disable incompatible plug-ins from config. It provides proper debugging as well.
Cloud-based IDEs
Cloud9 IDE - cloud-based IDE with native support for development of Node.js applications including debugging and other features.
Koding Koding offers you a free rootable VM with Node. Also you can work on the same code with your friends.
Other than these two you can use almost any code editor/IDE which simplifies JavaScript based development in general (for example with syntax highlighting, autocompletion or similar stuff) and use node with its built-in V8 debugger.
Microsoft just launch a cross platform IDE "Visual Studio Code" in Windows, Ubuntu and MacOSX. It could debug node.js. Check detail here.
Koding is another good choice. It comes preinstalled with Node.js, Vim and Emacs, has a great community of developers, among many other things. Another few notable features are:
Free virtual machine (VM) with Ubuntu, root access, apt-get, and many commonly used tools
Built-in Terminal with 256-color support
All languages, databases, and command-line tools are supported
Various file upload options such as Drag & Drop, Dropbox, Clone from Github, FTP and the ability to access them using SSH
Real-time code and terminal collaboration with integrated chat abilities
Visual Studio now supports full dev lifecycle for Node.js if you install the Node.js tools, linked below.
Allows for full debugging, intellisense, color coding, and more.
https://nodejstools.codeplex.com/
vim and unix are your IDE.
If you want debugging then there is node debug foo.js or ndb or node-inspector or use the V8 Debugger.
Another option could be Netbeans with the NodeJS tools (even though I'm not using it anymore these days since I've been using JetBrains products now to be honest).
What it gives you:
A Node project type
Clickable stack traces in the output window
A run with node action on Javascript files (and of course, the project)
Integration with Node Package Manager (npm) and a slick little UI for adding libraries
GUI for editing package.json files, and generating their standard contents
Ability to store machine-specific command-line arguments (excluded from version control if you use NetBeans' version control).
Ability to download Node's sources so the highlighted stack traces point somewhere
http://timboudreau.com/blog/read/NetBeans_Tools_for_Node_js
Also NetBeans 8.1 and 8.2 seem to have brought some features for Node.js developers (see here and here).
Eclipse is a good IDE for JavaScript.
This page https://portawiki.abnoctus.com/view/NodeIDE.html
details mixing eclipseJS with the google v8 debugger and a few node specific plugins
http://code.abnoctus.com/publish/binaries/node-launcher/
To build an IDE with support for editing JS with syntax highlights and some degree of code completion, executing node from the IDE, debugging in the IDE, unit testing with nodeunit and fetching dependencies via NPM.
I've tested several IDE's to develop and run node apps. But I'm feeling very confortable with Microsoft WebMatrix 2.0. It's a nice lightweight and free IDE that you can run Node. There's some templates for Express framework to get started. And you can run nodejs processes through IIS Express.
Nodeclipse has chromedevtools fixed for Node.js debugging.
Enide Studio 2014 comes with Nodeclipse, JSHint-eclipse, AngularJS and more plugins
(source: nodeclipse.org)
(source: nodeclipse.org)
http://www.nodeclipse.org/enide/studio/2014/
Personally, I'm partial to Cloud9's IDE though they've had a few issues lately with various upgrades, and the growing pains of online systems can be an issue.
WebStorm 4 is another option, though I haven't tried it, I did try the plugin in WS3, which wasn't too bad.
From Microsoft (of all places) there's WebMatrix 2 from Microsoft that seems to support Node.JS pretty well. I have discovered that you can actually edit node based js files within the Visual Studio 2012 beta and get intellisense/autocomplete for node scripts probably from webmatrix's developments. I've been using node as a build step for CSS/JS processing, and it's been working well for me.
Aptana Studio and others seem to be scrambling to add proper node support. Right now options are relatively limited, but getting better.
What framework are you using for the frontend? If you're already familiar with Node, you might as well try the open-source and increasingly popular Meteor.JS framework. Check out MeteorPad for literally a one-click IDE for Meteor apps.
You get a virtual machine with MongoDB on it and the Meteor server. A sample project is already loaded, and you can edit the server and client HTML, JS and CSS files. The resulting app runs in the right pane. Makes playing with Meteor super, super easy.
Node is a relatively new project so there is not widespread IDE support yet. However there actually is an online IDE called Cloud9 IDE that you might want to check out. Otherwise I suggest you use a local editor such as vim or emacs.
See how-to-debug-node-js-applications for more information on debugging.
GitHub's programmable text editor Atom has node.js integration.
Try Microsoft's https://code.visualstudio.com. Its awesome.
Facebook's Nuclide has a number of IDE-esque features including dynamic typechecking (via flow), in-code linking, auto complete, etc. It's based on GitHub's Atom so you can pick and choose Nuclide packages as you see fit.
WebStorm 3.0 does all this stuff.
It auto completes in a smart way, includes nice debugging and unit testing. It also include number of inspection for javascript, which is also pleasant.
Now RC version is available, but JetBrains assure that it'll be released soon.
I use IntelliJ's Webstorm: http://www.jetbrains.com/webstorm for it's advance auto-complete features and Node.js/NodeUnit templates.

Resources