Created
November 23, 2021 15:13
-
-
Save Jonathan-Dobson/69e4589dbffd4c9e6a270c337b2d8e58 to your computer and use it in GitHub Desktop.
Open browser from node script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const url = 'http://localhost' | |
require('child_process') | |
.exec((process.platform | |
.replace('darwin','') | |
.replace(/win32|linux/,'xdg-') + 'open ' + url)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment