Skip to content

Instantly share code, notes, and snippets.

@du5rte
Last active April 26, 2017 16:41
Show Gist options
  • Save du5rte/2e580ea588a9f7843cdde9376efc6ff6 to your computer and use it in GitHub Desktop.
Save du5rte/2e580ea588a9f7843cdde9376efc6ff6 to your computer and use it in GitHub Desktop.
dotenv improvements
// better file checker
// https://nodejs.org/dist/latest-v7.x/docs/api/fs.html#fs_fs_readfilesync_file_options
fs.accessSync(path.resolve(__dirname,'./config-local.json'), fs.R_OK);
// add .env.js
```js
const envJS = require('./.env.js')
await envJS()
```
```js
export default async function() {
return await fetch('http://someoauth.com/auth')
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment