I just tested I forgot that I had the
ENV_PATH set https://wiki.keyboardmaestro.com/action/Execute_a_Shell_Script#Path_in_Shell_Scripts
I also use nvm so I have this set in my zshrc right above where nvm is loaded
export NVM_SYMLINK_CURRENT=true which makes a symlink to nvm's current version, e.g. the path
$NVM_DIR/current/bin is then always pointing to the current node version for me, I did have to expand it out so my
ENV_PATH looks like
I've got node
13.8.0 on my machine and you can pass flags in as well to
top-level await is a new JS thing that's coming soon but it's currently hidden behind a feature flag but you can get rid of the
IIFE by using the mjs extension and passing it in
--no-warnings is needed because node throws a warning saying your using an experimental feature.
#!/usr/bin/env node --harmony-top-level-await --no-warnings
import getStdin from 'get-stdin'
import slugify from 'slugify'
const input = await getStdin()
const slugifiedInput = slugify(input)