Skip to content

Instantly share code, notes, and snippets.

@Jaballadares
Last active June 25, 2021 17:23
Show Gist options
  • Save Jaballadares/470bdc38fbe575dc4ece2df107990abb to your computer and use it in GitHub Desktop.
Save Jaballadares/470bdc38fbe575dc4ece2df107990abb to your computer and use it in GitHub Desktop.
createRequire.js
import { createRequire } from "module";
const require = createRequire(import.meta.url);
// usage
const creds = require('./config/creds.json');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment