https://github.com/deptno/inject-direnv
:inbox_tray: Inject `.envrc` 🍳 WebStorm
https://github.com/deptno/inject-direnv
direnv envrc evironment intellij intellij-plugin webstorm webstorm-plugin webstorm-settings
Last synced: 3 months ago
JSON representation
:inbox_tray: Inject `.envrc` 🍳 WebStorm
- Host: GitHub
- URL: https://github.com/deptno/inject-direnv
- Owner: deptno
- Created: 2018-10-10T08:15:53.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-18T08:01:47.000Z (almost 7 years ago)
- Last Synced: 2025-06-01T05:14:04.979Z (4 months ago)
- Topics: direnv, envrc, evironment, intellij, intellij-plugin, webstorm, webstorm-plugin, webstorm-settings
- Language: TypeScript
- Homepage:
- Size: 526 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# inject-direnv
find `.envrc`(until root directory) inject export variable
if you are using JetBrain series, You can run IDE Run(`option` + `F11`) with injected `.envrc`## Install
```bash
npm install -D inject-direnv
```## Usage
### WebStorm (Intellij)
**Run** Intellij(WebStorm)
`Ctrl` + `A`
### In code
```javascript
import 'inject-direnv'
```## Configuration
Default target direnv file is `.envrc`,
you can change with `INJECT_DIRENV_ENVRC` variableEdit `.envrc.local`
```text
export ENVRC_LOCAL=yes
```Export `INJECT_DIRENV_ENVRC`
```bash
export INJECT_DIRENV_ENVRC=.envrc.local
```Load package
```javascript
import 'inject-direnv'console.log(process.env.ENVRC_LOCAL)
// yes
```## Basic concept
```bash
vim .envrc
```save below text
```bash
export INJECT=true
```*Run* `node` with `-r inject-direnv` option
```bash
node -r inject-direnv
> process.env.INJECT
'true'
```## License
MIT