Skip to content

Instantly share code, notes, and snippets.

@subfuzion
subfuzion / README.md
Last active December 21, 2024 19:48
Node.js 21.1.0 - build single executable application

Sharing my project's build script in case it's useful to others. I'm not testing for Windows, which is why the script reports an error, but just note that emitting Windows executables is actually supported by the Node API (see docs). Feel free to use and modify.

Notes

  • Webpack is used for bundling.
  • The entry point for the webpack config for my example is ./bin/app, which was an executable Node.js script with a shebang line. Update the config to point to whatever your app's entry point is.
  • The SEA config file uses disableExperimentalSEAWarning to suppress the experimental warning displayed when running a generated executable. This didn't work for Node 20.1.0 (see issue), but it has been tested and does work for 21.1.0.
@m1keall1son
m1keall1son / WMFVideoReadWrite.cpp
Last active February 19, 2022 07:48
C++ Program to read a video file and re-encode it to H.264 / AAC using Windows Media Foundation
//USAGE $ program.exe path\\to\\video-in.mp4 path\\to\\video-out.mp4
#include <iostream>
#include <string>
#include <mfidl.h> // Media Foundation interfaces
#include <mfapi.h> // Media Foundation platform APIs
#include <mferror.h> // Media Foundation error codes
#include <mfreadwrite.h>
#include <wmcontainer.h> // ASF-specific components