Skip to content

Instantly share code, notes, and snippets.

type memory(bytes)
==== ======
empty object 62.91456
object (1 prop) 71.303168
object (2 props) 94.37184
object (3 props) 111.149056
object (4 props) 127.926272
object (4 str props) 289.406976
string (empty) 46.137344
string (1) 54.525952
var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', function (req, res, next) {
res.render('index', { title: 'Bobblehead Generator' });
});
var oxford = require('project-oxford');
var client = new oxford.Client(process.env.OXFORD_API);

Node.js tooling: Engineering working notes

🏃 In-progress and incomplete: still trying to wrap my head around much of it, coordinating with partner teams to enable the right interfaces, etc., and there are a bunch of unanswered Qs, but just wanted to get the conversation started.

###Goal: Build Best-of-Breed Node.js Developer Experiences In particular, we'll be focusing on inner-loop development, but at the same time we'll want to ensure that the same awesome experience transcends product/service boundaries.

####Table Stakes First and foremost, it's important that we agree on a set of table stakes. These are the experiences that are really foundational - without them, it's a no-op.

  • Debugging (including sourcemaps) needs to be consistent and reliable

Ok, so I figured out and I have it working in both C++ and C# depending on which language you prefer.

Here are the steps for each, and if you’re curious how I debugged it, I described what I did below. Note that I’m in Visual Studio Pro, not Express so certain options might be in different places.

Let me know if this still doesn’t work….

C++

  1. Download latest stable version of OpenCV (I used 2.4.2) http://sourceforge.net/projects/opencvlibrary/files/latest/download?source=files
  2. Extract it to the folder you want OpenCV in (you will reference this folder later, so don’t just keep it in downloads)
A full-blown Node.js experience in Visual Studio? Who knew?! Node.js Tools for Visual Studio (NTVS) is a free, open-source extension that turns Visual Studio into a Node.js IDE. NTVS includes powerful editing features, Intellisense, debugging locally and remotely (Windows/MacOS/Linux), profiling, an interactive window (REPL), npm integration, TypeScript, Azure Web Sites / Cloud Services, and much more!
Visit http://aka.ms/ntvslatest to learn more about the latest release and download the free tools.
@mousetraps
mousetraps / gist:bd5662028d9190f095cc
Created August 4, 2015 18:48
NTVS debug output from node v0.12.4
[18:40:31.1354533] --------------------------------------------------------------------------------
[18:40:31.1434589] AD7Engine Created (20843689)
[18:40:31.1484625] AD7Engine Called SetRegistryRoot
[18:40:31.1494632] AD7Engine Called SetLocale
[18:40:31.1534664] AD7Engine LaunchSuspended Called with flags 'LAUNCH_ENABLE_ENC' (20843689)
[18:40:31.7899177] DebuggerConnection: Request: {"command":"scripts","seq":1,"type":"request","arguments":{"includeSource":false}}
[18:40:31.7669022] DebuggerConnection: Established connection.
[18:40:31.9009961] DebuggerConnection: Response: {"seq":0,"type":"event","event":"compileError","success":true,"body":{"script":{"handle":1,"type":"script","name":"C:\\Users\\itani\\documents\\visual studio 2013\\Projects\\NodejsConsoleApp73\\app.js","id":72,"lineOffset":0,"columnOffset":0,"lineCount":2,"sourceStart":"(function (exports, require, module, __filename, __dirname) { console.log('Hello","sourceLength":93,"scriptType":2,"compilationType":0,"context":{"ref":0},"text":"C:\\Use