-
-
Save schalkneethling/d13c3e3a3f03e18ca8c1ab7a140abbe7 to your computer and use it in GitHub Desktop.
Random snippets
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
# count all `index.html` and `index.md` files in the current directory recursively. | |
find . -iname 'index.html' -o -iname 'index.md' | wc -l |
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
// __dirname in ESM | |
import { fileURLToPath } from "url"; | |
const __dirname = path.dirname(fileURLToPath(import.meta.url)); | |
// for use in ESM | |
import { createRequire } from "module"; | |
const require = createRequire(import.meta.url); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment