current keyboard layout and language • Doing language / script detec0on of text via cld2 • Spellchecking • Checking whether the OS is in presenta0on mode • Detec0ng whether we're in a Remote Desktop session
that integrates with node.js, just like you would for server-side node.js • Go?a think about three different plaCorms • Debugging is Not A Joy, but at least you can try your module in node.js first • Always, always, always use nodejs/nan
Electron na:ve node.js module. It shows: • How to write OS-specific implementa5ons • Split your normal C++ code away from your Nan code and integrate it at the last minute • Write the bare minimum C++ code and use a JS shim to fill in the blanks (lib/spellchecker.js)
a super-ass new version of io.js, and your system node.js probably isn't that, so anything you install via npm install is Borked • Even if they're the same, on Windows, you'll get module iniAalizaAon failures if you try to use an io.js module
result.dwOSVersionInfoSize = OSVERSIONINFO.size; let failed = (kernel32.GetVersionExA(result.ref()) === 0); if (failed) { let gle = kernel32.GetLastError(); throw new Error(`Failed to get version information: 0x${gle.toString(16)}`); } return { major: result.dwMajorVersion, minor: result.dwMinorVersion, build: result.dwBuildNumber, }; }