Sharing Sheets with Hermes
Hermes is an embeddable JS engine written in C++.
SheetJS is a JavaScript library for reading and writing data from spreadsheets.
This demo uses Hermes and SheetJS to pull data from a spreadsheet and print CSV rows. We'll explore how to load SheetJS in a Hermes context and process spreadsheets from a C++ program.
The "Integration Example" section includes a complete command-line tool for reading data from files.
Integration Details
Many Hermes functions are not documented. The explanation was verified against
commit 8ef11b4.
The main target for Hermes is React Native. At the time of writing, there was no official documentation for embedding the Hermes engine in C++ programs.
Initialize Hermes
A Hermes engine instance is created with facebook::hermes::makeHermesRuntime:
std::unique_ptr<facebook::jsi::Runtime> rt(facebook::hermes::makeHermesRuntime());
Essential Objects
Hermes does not expose a console or global variable, but they can be
synthesized from JS code in the runtime:
globalcan be obtained from a reference tothisin an unbound function:
/* create global object */
var global = (function(){ return this; }).call(null);
console.logcan be constructed from the builtinprintfunction:
/* create a fake `console` from the hermes `print` builtin */
var console = { log: function(x) { print(x); } };
The code can be stored in a C string and evaluated using prepareJavascript to
prepare code and evaluatePreparedJavascript to evaluate:
const char *init_code =
/* create global object */
"var global = (function(){ return this; }).call(null);"
/* create a fake `console` from the hermes `print` builtin */
"var console = { log: function(x) { print(x); } };"
;
auto src = std::make_shared<facebook::jsi::StringBuffer>(init_code);
auto js = rt->prepareJavaScript(src, std::string("<eval>"));
rt->evaluatePreparedJavaScript(js);
Standard C++ exception handling patterns are used in Hermes integration code.
The base class for Hermes exceptions is facebook::jsi::JSIException:
try {
const char *init_code = "...";
auto src = std::make_shared<facebook::jsi::StringBuffer>(init_code);
auto js = rt->prepareJavaScript(src, std::string("<eval>"));
rt->evaluatePreparedJavaScript(js);
} catch (const facebook::jsi::JSIException &e) {
std::cerr << "JavaScript exception: " << e.what() << std::endl;
return 1;
}
Load SheetJS Scripts
SheetJS Standalone scripts can be parsed and evaluated in a Hermes context.
The main library can be loaded by reading the script from the file system and evaluating in the Hermes context.
There are nonstandard tricks to embed the entire script in the binary. There are
language proposals such as #embed (mirroring the same feature in C23).
For simplicity, the examples read the script file from the filesystem.
Reading scripts from the filesystem
For the purposes of this demo, the standard C <stdio.h> methods are used:
static char *read_file(const char *filename, size_t *sz) {
FILE *f = fopen(filename, "rb");
if(!f) return NULL;
long fsize; { fseek(f, 0, SEEK_END); fsize = ftell(f); fseek(f, 0, SEEK_SET); }
char *buf = (char *)malloc(fsize * sizeof(char));
*sz = fread((void *) buf, 1, fsize, f);
fclose(f);
return buf;
}
// ...
/* read SheetJS library from filesystem */
size_t sz; char *xlsx_full_min_js = read_file("xlsx.full.min.js", &sz);
For Windows applications, the string must be null-terminated:
/* Hermes-Windows requires the null terminator */
static char *read_file_null(const char *filename, size_t *sz) {
FILE *f = fopen(filename, "rb");
if(!f) return NULL;
long fsize; { fseek(f, 0, SEEK_END); fsize = ftell(f) + 1; fseek(f, 0, SEEK_SET); }
char *buf = (char *)malloc(fsize * sizeof(char));
*sz = fread((void *) buf, 1, fsize, f);
buf[fsize - 1] = 0;
fclose(f);
return buf;
}
// ...
/* read SheetJS library from filesystem */
size_t sz; char *xlsx_full_min_js = read_file_null("xlsx.full.min.js", &sz);
Hermes Wrapper
Hermes does not provide a friendly way to prepare JavaScript code stored in a standard heap-allocated C string. Fortunately a wrapper can be created:
/* Unfortunately the library provides no C-friendly Buffer classes */
class CBuffer : public facebook::jsi::Buffer {
public:
CBuffer(const uint8_t *data, size_t size) : buf(data), sz(size) {}
size_t size() const override { return sz; }
const uint8_t *data() const override { return buf; }
private:
const uint8_t *buf;
size_t sz;
};
// ...
/* load SheetJS library */
auto src = std::make_shared<CBuffer>(CBuffer((uint8_t *)xlsx_full_min_js, sz));
Evaluating SheetJS Library Code
The code wrapper can be "prepared" with prepareJavascript and "evaluated" with
evaluatePreparedJavascript.
The second argument to preparedJavascript is a C++ std::string that holds
the source URL. Typically a name like xlsx.full.min.js helps distinguish
SheetJS library exceptions from other parts of the application.
auto js = rt->prepareJavaScript(src, std::string("xlsx.full.min.js"));
rt->evaluatePreparedJavaScript(js);
Testing
If the library is loaded, XLSX.version will be a string. This string can be
pulled into the main C++ program.
The evaluatePreparedJavascript method returns a facebook::jsi::Value object
that represents the result:
/* evaluate XLSX.version and capture the result */
auto src = std::make_shared<facebook::jsi::StringBuffer>("XLSX.version");
auto js = rt->prepareJavaScript(src, std::string("<eval>"));
facebook::jsi::Value jsver = rt->evaluatePreparedJavaScript(js);
The getString method extracts the string value and returns an internal string
object (facebook::jsi::String). Given that string object, the utf8 method
returns a proper C++ std::string that can be printed:
/* pull the version string into C++ code and print */
facebook::jsi::String jsstr = jsver.getString(*rt);
std::string cppver = jsstr.utf8(*rt);
std::cout << "SheetJS version " << cppver << std::endl;
Reading Files
Typically C++ code will read files and Hermes will project the data in the JS
engine as an ArrayBuffer. SheetJS libraries can parse ArrayBuffer data.
Standard SheetJS operations can pick the first worksheet and generate CSV string
data from the worksheet. Hermes provides methods to convert the JS strings back
to std::string objects for further processing in C++.
It is strongly recommended to create a stub function to perform the entire workflow in JS code and pass the final result back to C++.
Hermes Wrapper
Hermes supports ArrayBuffer but has no simple helper to read raw memory.
Libraries are expected to implement MutableBuffer:
/* ArrayBuffer constructor expects MutableBuffer */
class CMutableBuffer : public facebook::jsi::MutableBuffer {
public:
CMutableBuffer(uint8_t *data, size_t size) : buf(data), sz(size) {}
size_t size() const override { return sz; }
uint8_t *data() override { return buf; }
private:
uint8_t *buf;
size_t sz;
};
A facebook::jsi::ArrayBuffer object can be created using the wrapper:
/* load payload as ArrayBuffer */
size_t sz; char *data = read_file("pres.xlsx", &sz);
auto payload = std::make_shared<CMutableBuffer>(CMutableBuffer((uint8_t *)data, sz));
auto ab = facebook::jsi::ArrayBuffer(*rt, payload);
SheetJS Operations
In this example, the goal is to pull the first worksheet and generate CSV rows.
XLSX.read1 parses the ArrayBuffer and returns a SheetJS workbook object:
var wb = XLSX.read(buf);
The SheetNames property2 is an array of the sheet names in the workbook.
The first sheet name can be obtained with the following JS snippet:
var first_sheet_name = wb.SheetNames[0];
The Sheets property3 is an object whose keys are sheet names and whose
corresponding values are worksheet objects.
var first_sheet = wb.Sheets[first_sheet_name];
The sheet_to_csv utility function4 generates a CSV string from the sheet:
var csv = XLSX.utils.sheet_to_csv(first_sheet);
C++ integration code
The stub function will be passed an ArrayBuffer object:
function(buf) {
/* `buf` will be an ArrayBuffer */
var wb = XLSX.read(buf);
return XLSX.utils.sheet_to_csv(wb.Sheets[wb.SheetNames[0]]);
}
The result after evaluating the stub is a facebook::jsi::Value object:
/* define stub function to read and convert first sheet to CSV */
auto src = std::make_shared<facebook::jsi::StringBuffer>(
"(function(buf) {"
"var wb = XLSX.read(buf);"
"return XLSX.utils.sheet_to_csv(wb.Sheets[wb.SheetNames[0]]);"
"})"
);
auto js = rt->prepareJavaScript(src, std::string("<eval>"));
facebook::jsi::Value funcval = rt->evaluatePreparedJavaScript(js);
To call this function, the opaque Value must be converted to a Function:
facebook::jsi::Function func = func.asObject(*rt).asFunction(*rt);
The Function exposes a call method to perform the function invocation. The
stub accepts an ArrayBuffer argument:
/* call stub function and capture result */
facebook::jsi::Value csv = func.call(*rt, ab);
In the same way the library version string was pulled into C++ code, the CSV
data can be captured using getString and utf8 methods:
/* interpret as utf8 */
std::string str = csv.getString(*rt).utf8(*rt);
std::cout << str << std::endl;
Complete Example
The "Integration Example" covers a traditional integration in a C++ application,
while the "CLI Test" demonstrates other concepts using the hermes CLI tool.
Integration Example
This demo was tested in the following deployments:
| Architecture | Git Commit | Date |
|---|---|---|
darwin-x64 | f45c6bc | 2026-03-06 |
darwin-arm | f45c6bc | 2026-01-23 |
linux-x64 | 8ef11b4 | 2025-04-21 |
linux-arm | f45c6bc | 2026-03-07 |
The main Hermes source tree does not have Windows support. The hermes-windows
fork, which powers React Native for Windows, does have built-in support5
| Architecture | Git Commit | Date |
|---|---|---|
win11-x64 | f9abcf6 | 2026-05-26 |
win11-arm | 4c64b05 | 2025-02-23 |
The "Windows Example" covers hermes-windows.
- Install dependencies
Installation Notes (click to show)
On macOS, the Xcode command-line tools ship with git. The other dependencies
should be installed with brew:
brew install icu4c cmake ninja
On HoloOS (and other Arch Linux distros), the dependencies must be installed
from the root user (using sudo):
sudo pacman -Syu cmake git ninja icu python zip readline
On Debian and Ubuntu, python-is-python3 should be installed:
sudo apt install cmake git ninja-build libicu-dev python3 python-is-python3 zip libreadline-dev
Linux builds require at least 8 GB memory.
- Make a project directory:
mkdir sheetjs-hermes
cd sheetjs-hermes
- Download the
Makefile:
curl -LO https://docs.sheetjs.com/hermes/Makefile
- Download
sheetjs-hermes.cpp:
curl -LO https://docs.sheetjs.com/hermes/sheetjs-hermes.cpp
- Build the library (this is the
inittarget):
make init
In some test runs using CMake 4, the build failed due to CMake issues:
CMake Error at CMakeLists.txt:42 (cmake_policy):
Policy CMP0026 may not be set to OLD behavior because this version of CMake
no longer supports it. The policy was introduced in CMake version 3.0.0,
and use of NEW behavior is now required.
The referenced line should be removed:
# bundles for Apple platforms.
if (POLICY CMP0026)
cmake_policy(SET CMP0026 OLD) <-- remove this line
endif()
After removing the line, remove the build_release tool and try again:
rm -rf build_release
make init
In some test runs, the build failed due to Ninja issues:
CMake Error at CMakeLists.txt:64 (project):
Running
'/usr/local/lib/depot_tools/ninja' '--version'
failed with:
depot_tools/ninja.py: Could not find Ninja in the third_party of the current project, nor in your PATH.
This is due to a conflict with the Ninja version that ships with depot_tools.
Since depot_tools typically is added before other folders in the system PATH
variable, it is strongly recommended to rename the ninja binary, build the
Hermes libraries, and restore the ninja binary:
# Rename `ninja`
mv /usr/local/lib/depot_tools/ninja /usr/local/lib/depot_tools/ninja_tmp
# Build Hermes
make init
# Restore `ninja`
mv /usr/local/lib/depot_tools/ninja_tmp /usr/local/lib/depot_tools/ninja
In some tests, the build failed with a message referencing a missing header:
hermes/API/hermes/inspector/chrome/tests/SerialExecutor.cpp:34:16: note: ‘std::runtime_error’ is defined in header ‘<stdexcept>’; did you forget to ‘#include <stdexcept>’?
hermes/lib/SerialExecutor/SerialExecutor.cpp:9:1: note: ‘std::runtime_error’ is defined in header ‘<stdexcept>’; did you forget to ‘#include <stdexcept>’?
This error affects the official Hermes releases!
The #include statement should be added in the corresponding header file. In
previous tests, the following files elicited errors:
hermes/API/hermes/inspector/chrome/tests/SerialExecutor.cpperrors are fixed by patchingAPI/hermes/inspector/chrome/tests/SerialExecutor.hin the repo:
#include <memory>
#include <mutex>
#if !defined(_WINDOWS) && !defined(__EMSCRIPTEN__)
#include <stdexcept>
#include <pthread.h>
#else
#include <thread>
hermes/lib/SerialExecutor/SerialExecutor.cpperrors are fixed by patchinginclude/hermes/SerialExecutor/SerialExecutor.hin the repo:
#include <memory>
#include <mutex>
#if !defined(_WINDOWS) && !defined(__EMSCRIPTEN__)
#include <stdexcept>
#include <pthread.h>
#else
#include <thread>
After making the required patch, the build can be resumed by running cmake:
cmake --build ./build_release`
- Build the application:
make sheetjs-hermes
- Download the SheetJS Standalone script and the test file. Save both files in the project directory:
curl -LO https://cdn.sheetjs.com/xlsx-0.20.3/package/dist/xlsx.full.min.js
curl -LO https://docs.sheetjs.com/pres.numbers
- Copy the
libhermesandlibjsilibraries into the current folder:
- Linux
- MacOS
cp ./build_release/API/hermes/libhermes.so .
cp ./build_release/jsi/libjsi.so .
Some Hermes releases build static libraries, rendering this step unnecessary.
if [ -e ./build_release/API/hermes/libhermes.dylib ]; then cp ./build_release/API/hermes/libhermes.dylib .; fi
if [ -e ./build_release/jsi/libjsi.dylib ]; then cp ./build_release/jsi/libjsi.dylib .; fi
- Run the application:
./sheetjs-hermes pres.numbers
If successful, the program will print the library version number and the contents of the first sheet as CSV rows.
Windows Example
The commands must be run in a VS 2022 "Native Tools Command Prompt".
- Install dependencies.
Installation Notes (click to show)
The build sequence requires Python, which can be installed from the official Windows installer6.
Visual Studio 2022 "Desktop development with C++" workload must be installed7.
The following VS 2022 "Individual components" must be added:
- C++ CMake tools for Windows
- C++/CLI support for v143 build tools (Latest)
- C++ Clang Compiler for Windows (19.1.5)
- MSBuild support for LLVM (clang-cl) toolset
In addition, the architecture-specific Spectre-mitigated libs must be added:
- x64
- ARM64
- MSVC v143 - VS 2022 C++ x64/x86 Spectre-mitigated libs (Latest)
- C++ ATL for latest v143 build tools with Spectre Mitigations (x86 & x64)
- C++ MFC for latest v143 build tools with Spectre Mitigations (x86 & x64)
Search for "spectre latest x64" (no quotation marks) and select each option.
- MSVC v143 - VS 2022 C++ ARM64/ARM64EC Spectre-mitigated libs (Latest)
- C++ ATL for latest v143 build tools with Spectre Mitigations (ARM64/ARM64EC)
- C++ MFC for latest v143 build tools with Spectre Mitigations (ARM64/ARM64EC)
Search for "spectre latest arm64" (no quotation marks) and select each option.
Out of the box, Windows 11 will alias python, redirecting unsuspecting users
to the App Installer. This redirect must be disabled:
Type alias in the search bar and select "Manage app execution aliases", In the
settings pane, scroll down and turn off the alias for python.exe.
- Set up
depot_toolstoc:\src\:
cd c:\
mkdir src
cd src
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
Add the path c:\src\depot_tools\ to the User PATH environment variable
Environment Variable Setup (click to show)
Type env in the search bar and select "Edit the system environment variables".
In the new window, click the "Environment Variables..." button.
In the new window, look for the "User variables" section. Select "Path" in the list and click "Edit".
In the new window, click "New" and type c:\src\depot_tools and press Enter.
Select the row and repeatedly click "Move Up" until it is the first entry.
Click "OK" in each window (3 windows) and restart your computer.
-
Delete
c:\src\depot_tools\ninjaif it exists, then download the official Windows release and move theninja.exeintoc:\src\depot_tools. If aninja.exeexists in the folder, replace the existing program. -
Make a project directory:
mkdir sheetjs-hermes
cd sheetjs-hermes
- Clone the
hermes-windowsrepo:
git clone https://github.com/microsoft/hermes-windows
cd hermes-windows
git checkout f9abcf6
cd ..
If there are errors related to SSL or certificates or CApath, temporarily
disable SSL in Git:
git config --global http.sslVerify false
git clone https://github.com/microsoft/hermes-windows
git config --global http.sslVerify true
- Patch the build structure to ensure MSVC flags are used in
clang-cl.
The Hermes Windows fork switched to a new build structure that does not support
current MSVC build tools. The following patches force MSVC-style flags for use
with clang-cl.
API/jsi/jsi/CMakeLists.txt should force /EHsc:
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR
"${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
- list(APPEND jsi_compile_flags "-Wno-non-virtual-dtor")
+ list(APPEND jsi_compile_flags "/EHsc")
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC")
cmake/modules/Hermes.cmake should force MSVC-style flags:
if (HERMES_ENABLE_EH)
if (GCC_COMPATIBLE)
- list(APPEND flags -fexceptions)
+ list(APPEND flags /EHsc)
elseif (MSVC)
list(APPEND flags /EHsc)
endif ()
else ()
if (GCC_COMPATIBLE)
- list(APPEND flags -fno-exceptions)
+ list(APPEND flags /EHs-c-)
elseif (MSVC)
list(APPEND flags /EHs-c-)
endif ()
endif ()
if (HERMES_ENABLE_RTTI)
if (GCC_COMPATIBLE)
- list(APPEND flags -frtti)
+ list(APPEND flags /GR)
elseif (MSVC)
list(APPEND flags /GR)
endif ()
else ()
if (GCC_COMPATIBLE)
- list(APPEND flags -fno-rtti)
+ list(APPEND flags /GR-)
elseif (MSVC)
list(APPEND flags /GR-)
endif ()
endif ()
- Build the library:
- x64
- ARM64
cmake -S hermes-windows -B build -G "Visual Studio 17 2022" -A x64 -T ClangCL -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug -DHERMES_ENABLE_EH=ON -DHERMES_ENABLE_RTTI=ON
cmake --build build --config Debug
The build may fail with the message:
cannot be loaded because running scripts is disabled on this system
In a "Run as Administrator" powershell window, run the following command:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
The build may show a number of error messages involving exceptions:
error : cannot use 'try' with exceptions disabled
These errors can be ignored.
cmake -S hermes-windows -B build -G "Visual Studio 17 2022" -A arm64
cmake --build ./build
- Copy every generated
.liband.dllfile into the main folder:
for /r build %f in (*.dll) do copy /Y "%f" .
for /r build %f in (*.lib) do copy /Y "%f" .
- Download
sheetjs-hermesw.cpp:
curl -o sheetjs-hermesw.cpp https://docs.sheetjs.com/hermes/sheetjs-hermesw.cpp
- Build the application:
cl /std:c++17 /EHsc /MTd /Zi /I hermes-windows\API /I hermes-windows\public /I hermes-windows\API\jsi /c sheetjs-hermesw.cpp
link /OUT:sheetjs-hermesw.exe /DEBUG sheetjs-hermesw.obj *.lib winmm.lib
In some test runs, the build failed due to duplicate symbols:
hermesvmlean_a.lib(StaticHUnit.obj) : error LNK2005: _sh_unit_init_guarded already defined in hermesvm.lib(hermesvm.dll)
Libraries with duplicate symbols should be manually removed:
del hermesvm.lib hermesvm.dll hermesvmlean.lib hermesvmlean.dll
After deleting the libraries, delete the sheetjs-hermesw artifacts and build:
del sheetjs-hermesw.*
curl -o sheetjs-hermesw.cpp https://docs.sheetjs.com/hermes/sheetjs-hermesw.cpp
cl /std:c++17 /EHsc /MTd /Zi /I hermes-windows\API /I hermes-windows\public /I hermes-windows\API\jsi /c sheetjs-hermesw.cpp
link /OUT:sheetjs-hermesw.exe /DEBUG sheetjs-hermesw.obj *.lib winmm.lib
- Download the SheetJS Standalone script and the test file. Save both files in the project directory:
curl -o xlsx.full.min.js https://cdn.sheetjs.com/xlsx-0.20.3/package/dist/xlsx.full.min.js
curl -o pres.numbers https://docs.sheetjs.com/pres.numbers
- Run the application:
.\sheetjs-hermesw.exe pres.numbers
If successful, the program will print the library version number and the contents of the first sheet as CSV rows.
CLI Test
This demo was tested in the following deployments:
| Architecture | Hermes | Date |
|---|---|---|
darwin-x64 | 0.13.0 | 2026-03-06 |
darwin-arm | 0.13.0 | 2026-03-06 |
win11-x64 | 0.13.0 | 2026-05-10 |
win11-arm | 0.13.0 | 2025-02-23 |
linux-x64 | 0.13.0 | 2025-04-21 |
linux-arm | 0.13.0 | 2026-03-07 |
When this demo was last tested, jsvu did not install a native linux-arm
binary. Nevertheless, the process was tested using qemu-user to simulate the
linux-x64 program.
Due to limitations of the standalone binary, this demo will encode a test file as a Base64 string and directly add it to an amalgamated script.
In Windows, the demo should be run in "Command Prompt".
Install CLI
- Install the Hermes command line tools:
npx -y jsvu hermes@0.13.0
When prompted, select the appropriate operating system.
Installation Notes (click to show)
jsvu on Windows on ARM uses the X64 compatibility layer. When the demo was
last tested, the engine binaries were not native ARM64 programs.
jsvu will fail on Linux on ARM since the linux64 binary is X64. This error
can be ignored.
On this platform, qemu-user must be installed by the root user:
sudo apt install qemu-user
In Debian, the package includes bindings to support the binfmt_misc system.
- Inspect the output of the installer. Look for "Installing binary" lines:
❯ Extracting…
Installing binary to ~/.jsvu/engines/hermes-0.13.0/hermes-0.13.0…
Installing symlink at ~/.jsvu/bin/hermes-0.13.0 pointing to ~/.jsvu/engines/hermes-0.13.0/hermes-0.13.0…
Installing binary to ~/.jsvu/engines/hermes-0.13.0/hermes-0.13.0-compiler…
Installing symlink at ~/.jsvu/bin/hermes-0.13.0-compiler pointing to ~/.jsvu/engines/hermes-0.13.0/hermes-0.13.0-compiler…
The first "Installing binary" line mentions the path to the hermes tool.
Setup Project
- Create a new project folder:
mkdir sheetjs-hermes-cli
cd sheetjs-hermes-cli
- Copy the binary from Step 1 into the current folder.
- Linux/MacOS
- Windows
The typical location is ~/.jsvu/engines/hermes-0.13.0/hermes-0.13.0:
cp ~/.jsvu/engines/hermes-0.13.0/hermes-0.13.0 .
On Windows, all DLLs must be copied:
copy %userprofile%\.jsvu\engines\hermes-0.13.0\hermes-0.13.0.exe .
copy %userprofile%\.jsvu\engines\hermes-0.13.0\*.dll .
Create Script
- Download the SheetJS Standalone script and the test file. Save both files in the project directory:
curl -LO https://cdn.sheetjs.com/xlsx-0.20.3/package/dist/xlsx.full.min.js
curl -LO https://docs.sheetjs.com/pres.numbers
- Bundle the test file and create
payload.js:
node -e "fs.writeFileSync('payload.js', 'var payload = \"' + fs.readFileSync('pres.numbers').toString('base64') + '\";')"
- Create support scripts:
global.jscreates aglobalvariable and defines a fakeconsole:
var global = (function(){ return this; }).call(null);
var console = { log: function(x) { print(x); } };
hermes.jswill callXLSX.readandXLSX.utils.sheet_to_csv:
var wb = XLSX.read(payload, {type:'base64'});
console.log(XLSX.utils.sheet_to_csv(wb.Sheets[wb.SheetNames[0]]));
- Create the amalgamation
sheetjs.hermes.js:
- Linux/MacOS
- Windows
cat global.js xlsx.full.min.js payload.js hermes.js > sheetjs.hermes.js
type global.js xlsx.full.min.js payload.js hermes.js > sheetjs.hermes.js
The final script defines global before loading the standalone library. Once
ready, it will read the bundled test data and print the contents as CSV.
Testing
- Run the script using the Hermes standalone binary:
./hermes-0.13.0 sheetjs.hermes.js
If successful, the script will print CSV data from the test file.
Footnotes
-
See "Workbook Object" ↩
-
See "Workbook Object" ↩
-
See
microsoft/hermes-windowson GitHub ↩ -
See "Download Python" in the Python website. When the demo was last tested, Python 3.11.9 was installed. ↩
-
The VS 2022 link was removed from the download page. https://aka.ms/vs/17/release/vs_BuildTools.exe is a direct link. ↩