Docs for Azure Node SDK (not command line)? - javascript

I have an app that' already integrated wit hthe AWS SDK, and am investigating whether it could support Azure.
I've deployed some test sites with the Azure command line tools which (on Mac and Linux) are Node based, and I've seen the Azure SDK for Node but I was wondering if there's JavaScript (not command line) level documentation for the SDK.
Or, in short: where can I find docs on how to do (for example):
azure site create
In JavaScript?
I know I could inspect what the command line tools do, but I'd rather not.

Is this what you're looking for: http://dl.windowsazure.com/nodedocs?

Related

Remote debugging of Windows Node.js applications on Azure Web Apps or Azure Functions

I have Windows Node.js applications on Azure Web Apps or Azure functions.
It seems that VSC extensions allow us for only Linux.
How do I debug remotely?
For azure function, this is impossible now. We need to use Visual Studio to debug but it don't support javascript azure function. VS Code support javascript azure function but it also doesn't have any extension plugins to achieve remote debugging.
For azure web app, the azure app service extension plugin only support nodejs web app based on linux now.
So the answer of your question is no.

What is the role of Node.js in React-Native?

I'm trying to understand the development process of React-Native, so I've found information about Metro, And then I've read/watch this Metro video):
Metro is the development platform for React Native and it does that by
exposing an HTTP server so clients, in this case, emulators can
communicate with it and it also exposes a Websocket server so it can
push updates into the clients.
The docs talk about the "React Native Packager" (now called Metro, according to the video) which runs on port 8081, so that is the HTTP server that starts when we type react-native run-android for example?
Regarding the Websocket I still need to read more.
The documentation says we're running our JavaScript code in two environments, depending if we're in debug mode or not, which I understood. But this article confused me a little bit, says:
No. 4 You Code Does Not Run on Node.JS: The JavaScript runtime you’ve got is ether JavaScriptCore (non-debug) or V8 (debug). Even
though you can use NPM and a node server is running on the background,
your code does not actually run on Node.JS. So you won’t be able to
use of the Node.JS packages. A typical example is jsonwebtoken, which
uses NodeJS’s crypto module.
And, then I've read things like:
React Native uses Node.js, a JavaScript runtime, to build your
JavaScript code.
Node.js is a server-side JavaScript runtime environment. React
Native ships with some tools that are written for Node.js.
Node.js is an open source platform built on Chrome's JavaScript
runtime; it offers a way to easily build fast, scalable
programs. Node.js allows you to run JavaScript in Terminal, and helps
create modules.
In this article, it says:
Download node.js from nodejs.org. This JavaScript runtime gives you
access to npm, which is a convenient tool created by the node.js
project that you can use to manage open source packages. Make sure
that you download the latest LTS (Long Term Support) version of
node.js. Also included with this download is a development server
called the Metro bundler, which provides live updates when debugging.
So:
The role of Node.js in RN is to only access npm and manage the packages? and is Metro is includes in Node.js? Am I missing/confusing something? Thank you.
There are four types of JavaScript you'll write in todays environments:
1) Clientside browser JavaScript:
That's what gets sent to webbrowsers when they visit your webpage, it then gets executed in the browser at the clientside. As you want the JS to load fast and run on all kinds of browsers, you usually use transpilers to turn the modern ESnext you write into a minified version with better support.
2) Clientside native JavaScript:
Most devices do have a native JS runtime, therefore you can ship JS files with your Android / iOS / Desktop application and then start them there. These engines also support adding hooks from JavaScript into your native code, that's how React Native does provide it's APIs.
3) Serverside NodeJS JavaScript:
NodeJS is a runtime you'll use to run servers.
4) Buildscripts running on NodeJS:
You can use JavaScript to generate JavaScript files. That's how you bundle the files for (1) and (2) (maybe also (3)).
Now metro is a serverside buildscript (on NodeJS) that you can use to either a) start a server that serves your JS as a webpage (1 & 3), or b) that bundles your JS in a native App that you can install on your device (2).
The role of Node.js in RN is to only access npm and manage the packages?
No. metro is itself a package that you then run on NodeJS.

How to find whether software is installed or not in windows/mac using javascript or nodejs

My requirement is using Javascript I need to check whether xyz.msi/xyz.pkg application is installed or not in windows & mac system.
But I could not find any solution so I am trying through NodeJS. I have the following doubts
Will NodeJS help me to achieve above requirement?
Is there any way to get list of installed application using nodeJS
or by passing particular application name can I get information about that application using NodeJS.
If anyone has ideas, Please kindly share it.
tips:
I'm not sure javascript but node.js.
when you exec your project in node.js, you've has operate permission to do anything on your platform of os.
you can use child_process of node.js to exec shell on your pro and watch stdout to check if you have installed.

IBM Bluemix Cloud: IBM SDK for Node.js - Can our apps in Bluemix keep the existing version without auto-updates?

We tried to test IBM Bluemix Cloud and Watson Cloud by running
several Watson Cloud demo node.js apps inside our accounts, we
noticed the following situation:
After we installed the demo apps inside our account, it runs without problem; Because I have not opened this app in Bluemix DevOps tool. So, when this app
runs each time, this app does the following based on staging_task.log file:
"" Installing IBM SDK for Node.js (4.5.0)from cache""""
The above app frontend js code is written to work with this SDK and Node.js version.
# Later, I made another copy of the above demo app in our account. It runs without problem.
Then, I just opened the above app code in Bluemix DevOps tool and saved
the file without touching any code. Then, this version app does
not run.
Our investigation shows the following:
This staging_task.log file shows this fact: This version app after the above step does this now:
""" Installing IBM SDK for Node.js (4.6.2) from cache """
That means Bluemix Cloud automatically use the newer version of Node.js and SDK after the above step.
Another situation we found during our experiments may also be related to this problem:
*We deployed the following Watson demo app around Aug/2016, and we have not resaved any file in this app, so we guess that this demo
app still runs in the cached Run Environment (IBM SDK for Node.js
Verson 4 ??) in our account in Bluemix. So this demo app runs fast
and correctly in our account.
https://github.com/watson-developer-cloud/conversation-simple
*After the above deployment, there are several upgrading in Bluemix Cloud and Watson Cloud. The Run Environment many contains IBM SDK
for Node.js Verson 6 ??
*In last month, we deployed the above same demo app in our account. We found that this same app runs much slower than the above Aug/2016 deployment. Our guesses are that this demo app code is engineered based on IBM SDK for Node.js Verson 4.
The following Q supports our point: The auto-upgraded IBM SDK for Node.js in Bluemix Cloud or Watson Cloud may
have caused the problem in this Q. Now the IBM SDK for Node.js in Bluemix Cloud may be Version 6, this application may be engineered based on IBM SDK for Node.js Verson 4 (this version is not Node.js version in Package.json, but
IBM SDK version)
IBM Bluemix node.js native promise support
Our Q:
-Why is the above SDK and Node.js auto-upgraded ?
-How can we force this demo app to use the same version of IBM SDK and Node.js before we decide to upgrade them in
Bluemix Cloud? Thus to ensure that our existing apps run as normal.
Any thoughts and suggestions will be appreciated.
You can define node and npm versions in your package.json
{
"name":"iot-html5-phone",
"version":"0.0.1",
"scripts":{
"start":"node app.js"
},
"dependencies":{
},
"engines":{
"node":"0.10.26"
}
}
Use:
"engines":{
"node":"4.5.0"
}
( no carets or tildes )

Interactively debugging a Node.js application on Heroku?

My Node.js application runs correctly locally but it has errors once deployed to Heroku.
I cannot use node-inspector to debug as it requires three ports, and Heroku allows only one port.
https://discussion.heroku.com/t/how-to-debug-node-on-heroku-using-something-like-node-inspector/477/6
I cant use the debugger built into Node.js because I need a CLI to issue debugging commands.
http://nodejs.org/api/debugger.html#debugger_debugger
What is the best strategy for interactively debugging a Node.js application on Heroku?
Found One-Off Dynos, which allow:
Running a console (also known as a REPL shell) to run arbitrary code or inspect the app’s models against the live database. (e.g. rails console, irb, or node)
https://devcenter.heroku.com/articles/one-off-dynos#types-of-one-off-dynos
I didn't have time to test, but this should let me run the built in node debugger.

Categories

Resources