The complete project GroupDocs.Viewer for Node.js via Java — Code Examples with runnable examples and sample files is hosted on GitHub. The structure and commands below are based on this repository and its README.
cd ./GroupDocs.Viewer-for-Node.js-via-Java/Examples
Install dependencies
npm install
This installs the bundled groupdocs.viewer-<version>.tgz package and other dependencies defined in package.json. We typically keep the package up to date with the latest version. If you need to use a different package version, you can update the package.json file accordingly.
Alternatively, you can download the tgz file from the official GroupDocs Releases website. To install the package manually, copy the tgz file to the Examples directory and run the following command:
npm install ./groupdocs.viewer-*.tgz
If installation fails with native build errors, review the build tools section in System Requirements.
Configure license (optional)
If you have a license file, you can set the license path in the run_all_examples.js file. By default, GroupDocs.Viewer for Node.js via Java checks for the GROUPDOCS_LICENSE_PATH environment variable or looks for files with the .lic extension in the project’s root directory. You can also get a temporary license to test all the features.
Run all examples
npm start
You can also run individual examples by navigating to the folder containing the example script and running it. Output files are placed in the same folder as the script file.