Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Executable JavaScript Modules
":" //#;exec /usr/bin/env node --input-type=module - $@<$0
import process from 'process'
const { argv } = process
console.log(argv)
@subtleGradient
Copy link

subtleGradient commented Jul 30, 2021

Ran into an issue where prettier added a semicolon after ":" which broke this.
Adding prettier-ignore fixed it

":" /*prettier-ignore*/ //#;exec /usr/bin/env node --input-type=module - "$@" < "$0"

https://gist.github.com/subtleGradient/efb9bbea1400bc948b06859652c56d75/revisions#diff-c9a3d2ed9bfa0b7fa4f5ab7921276d3df64c217d65f4ef3878bd64ac2eb41008R1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment