This is the Node.js wrapper for the C++ librealsense2
for Intel® RealSense™ depth cameras (D400 series and the SR300).
Install Node.js
You will probably need to setup proxy of npm or https proxy of npm, if you don't have direct internet connection.
-
Install Python 2.7.xx, make sure "
Add python.exe to Path
" is checked during the installation. -
Install Visual Studio 2015 or 2017. The
Community
version also works. -
Install CMake, make sure
CMake
is in system PATH (Choose "Add CMake to the system PATH for all users
" or "Add CMake to the system PATH for the current user
" during the installation). This step is fornpm install
of Node.js GLFW module that is used inwrappers/nodejs/examples
.
Note#1: The npm module windows-build-tools
also works for npm install
Node.js bindings, but it's not suffcient to build the native C++ librealsense2.
Note#2: for Node.js GLFW module, add msbuild
to system PATH, e.g "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin
"
TODO:
Please refer to Linux installation doc or Windows installation doc to build native C++ librealsense2.
cd wrappers/nodejs
npm install
When Node.js wrapper is built, you can run examples to see if it works. Plug your Intel® RealSense™ camera and run the following commands
cd wrappers/nodejs/examples
npm install
node nodejs-capture.js
Open wrappers/nodejs/doc/index.html
for full reference document. If it isn't there, run the following commands to generate it:
cd wrappers/nodejs
node scripts/generate-doc.js
We're following Chromium coding style for different languages: C++, Python and JavaScript.
- Install depot_tools and added to
PATH
env. - Install Required npm modules,
cd src/tools && npm install
. - Run
./tools/linter.js
before submitting your code.
We use same Chromium commit log guideline and Github closing isses via commit messages. Use the following form:
Summary of change.
Longer description of change addressing as appropriate: why the change is made,
context if it is part of many changes, description of previous behavior and
newly introduced differences, etc.
Long lines should be wrapped to 80 columns for easier log message viewing in
terminals.
Fixes #123456