Skip to content

Commit

Permalink
clarify encoding usage (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbeatty committed Jan 15, 2019
1 parent c1645c9 commit 406d0d1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ $ DOTENV_CONFIG_<OPTION>=value node -r dotenv/config your_script.js
```

```bash
$ DOTENV_CONFIG_ENCODING=base64 node -r dotenv/config your_script.js dotenv_config_path=/custom/path/to/.env
$ DOTENV_CONFIG_ENCODING=latin1 node -r dotenv/config your_script.js dotenv_config_path=/custom/path/to/.env
```

## Config
Expand Down Expand Up @@ -114,7 +114,7 @@ Default: `utf8`
You may specify the encoding of your file containing environment variables.

```js
require('dotenv').config({ encoding: 'base64' })
require('dotenv').config({ encoding: 'latin1' })
```

#### Debug
Expand Down
2 changes: 1 addition & 1 deletion tests/test-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ t.test('takes option for path', ct => {
t.test('takes option for encoding', ct => {
ct.plan(1)

const testEncoding = 'base64'
const testEncoding = 'latin1'
dotenv.config({ encoding: testEncoding })

ct.equal(readFileSyncStub.args[0][1].encoding, testEncoding)
Expand Down
2 changes: 1 addition & 1 deletion tests/test-env-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ delete process.env.DOTENV_CONFIG_DEBUG
t.same(options(), {})

// sets encoding option
testOption('DOTENV_CONFIG_ENCODING', 'base64', { encoding: 'base64' })
testOption('DOTENV_CONFIG_ENCODING', 'latin1', { encoding: 'latin1' })

// sets path option
testOption('DOTENV_CONFIG_PATH', '~/.env.test', { path: '~/.env.test' })
Expand Down

0 comments on commit 406d0d1

Please sign in to comment.