sindresorhus/open ? reverse-engineered prompt
Reverse engineered prompt
Build me a small Node library that can open URLs, files, or apps from the command line in a cross platform way.
It should work on macOS, Windows, Linux, and WSL, and use the right system command under the hood, like open, start, or xdg open. I want a simple main function that opens something in the default app, plus a way to open a specific app with optional arguments. It should also support waiting for the opened app to exit, opening a new instance on macOS, and opening the browser in normal or private mode.
Please make it feel polished and practical, with good TypeScript types, clean ESM only exports, and sensible defaults. It should handle common browser names like Chrome, Firefox, Edge, Brave, and a generic default browser option. Include tests for the main cases and make sure it behaves well across platforms, including WSL path handling. If you need to check current platform behavior or docs online, go ahead and look them up.
Are you gonna build this?
make sure you review the code using coderabbit