# dot-globals

> It's for local globals variables

Latest version **0.0.6** (published 2018-03-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install dot-globals
pnpm add dot-globals
yarn add dot-globals
bun add dot-globals
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2018-03-29 |
| First published | 2018-03-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Shilov Oleg jr. |
| Maintainers | kara8ass |
| Keywords | globals, global, variables, local |

## Links

- npm: https://www.npmjs.com/package/dot-globals
- Repository: https://github.com/Kara8ass1337/dot-globals
- Issues: https://github.com/Kara8ass1337/dot-globals/issues
- npm.io page: https://npm.io/package/dot-globals

## Alternatives

- [messageformat](https://npm.io/package/messageformat.md) — 329.7K weekly downloads
- [@mintlify/scraping](https://npm.io/package/@mintlify/scraping.md) — 294.8K weekly downloads
- [@mintlify/previewing](https://npm.io/package/@mintlify/previewing.md) — 209.5K weekly downloads
- [@mintlify/prebuild](https://npm.io/package/@mintlify/prebuild.md) — 209.5K weekly downloads
- [@mintlify/link-rot](https://npm.io/package/@mintlify/link-rot.md) — 206.3K weekly downloads

## Recent versions

- 0.0.6 (latest) — 2018-03-29
- 0.0.4 — 2018-03-28
- 0.0.3 — 2018-03-28
- 0.0.2 — 2018-03-28
- 0.0.1 — 2018-03-28

## README

# dot-globals

It's convenient for local global variables.

### Usage

Install from npm

```npm i dot-globals```

Create .globals.js file.

Add it to .gitignore.

Set up your global variables, for example:

```javascript
const env = process.env.NODE_ENV;
const envProduction = (env === 'production');

module.exports = {
    webpackHost: 'localhost',
    webpackPort: '3001',
    serverUrl: envProduction ? 'http://localhost' : 'http://localhost:3000'
};
```

Require with path param (project root folder is default)

```javascript
const GLOBALS = require('dot-globals')();
```

And use them, for example:
```
devServer: {
        host: GLOBALS.webpackHost,
        port: GLOBALS.webpackPort,
        inline: true,
        hot: true,
        proxy: {
            '/' : {
                target: GLOBALS.serverUrl,
                secure: false
            }
        },
```

---
_Source: https://npm.io/package/dot-globals · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
