gitops-secrets-nodejs
gitops-secrets-nodejs copied to clipboard
Using with ` "type": "module",` in package.json / ES6
Hi Team,
Trying to spin this up for a nodejs
app and running into issues as we have
"type": "module",
set in our package.json
[nodemon] starting `node src/server.js`
file:///Users/me/code/platform-gateway/lib/secrets.js:3
const secrets = require("gitops-secrets/no-fs");
^
ReferenceError: require is not defined in ES module scope, you can use import instead
This file is being treated as an ES module because it has a '.js' file extension and '/Users/me/code/platform-gateway/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
at file:///Users/me/code/platform-gateway/lib/secrets.js:3:17
Is there an easy enough way around this ?
Chris :)