# @goesvt/svelte-use-env

> using environment variables with svelte

Latest version **1.0.9** (published 2021-02-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @goesvt/svelte-use-env
pnpm add @goesvt/svelte-use-env
yarn add @goesvt/svelte-use-env
bun add @goesvt/svelte-use-env
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.9 |
| Published | 2021-02-15 |
| First published | 2021-02-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 1.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | 1seok2 |
| Maintainers | goesnow |
| Keywords | svelte, env, environment, variables |

## Links

- npm: https://www.npmjs.com/package/@goesvt/svelte-use-env
- Repository: https://github.com/1Seok2/svelte-use-env
- Homepage: https://github.com/1Seok2/svelte-use-env#readme
- Issues: https://github.com/1Seok2/svelte-use-env/issues
- npm.io page: https://npm.io/package/@goesvt/svelte-use-env

## Dependencies (2)

- [dotenv](https://npm.io/package/dotenv.md) ^8.2.0
- [@rollup/plugin-replace](https://npm.io/package/@rollup/plugin-replace.md) ^2.3.4

## Alternatives

- [replicas-cli](https://npm.io/package/replicas-cli.md) — 3.0K weekly downloads
- [env-contract](https://npm.io/package/env-contract.md) — 133 weekly downloads
- [@openveo/api](https://npm.io/package/@openveo/api.md) — 61 weekly downloads
- [@ryniaubenpm2/cumque-error-reiciendis](https://npm.io/package/@ryniaubenpm2/cumque-error-reiciendis.md) — 54 weekly downloads
- [ts-global-type-extra](https://npm.io/package/ts-global-type-extra.md) — 11 weekly downloads

## Recent versions

- 1.0.9 (latest) — 2021-02-15
- 1.0.8 — 2021-02-15
- 1.0.7 — 2021-02-15

## README

# svelte withe environment variables

The sveltejs/template starter project doesn’t allow the use of environment variables out-of-the-box.

Env can be used by using this module with svelte.

<br/><br/>

## how to use

<br/>

### installation

```bash
npm install @goesvt/svelte-use-env
```

<br/>

### useage

Just following below code.

in `rollup.config.js` file

```jsx
...

import insertEnv from "@goesvt/svelte-use-env";

const production = !process.env.ROLLUP_WATCH;

...

export default {
    ...,
    plugins : [
        ...,
        insertEnv(),     // insert here !!
    ],
    ...
}
```

<br/>

then, you can create & use `.env` file as follows

```bash
APP_KEY=vr9e29399g83gnrvesd
```

<br/>

```jsx
/* App.js */

console.log(process.env.APP_KEY); // vr9e29399g83gnrvesd
```

---
_Source: https://npm.io/package/@goesvt/svelte-use-env · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
