Skip to content

Commit 7d0c74b

Browse files
committed
Fix package installation
1 parent 36122fb commit 7d0c74b

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,26 @@
44

55
A strongly-typed, 0-dependency environment variable parser for Typescript!
66

7+
## Get started
8+
9+
```bash
10+
npm install --save @amccarthy1/typed-env # npm
11+
```
12+
13+
```bash
14+
yarn add @amccarthy1/typed-env # yarn
15+
```
16+
17+
```ts
18+
import { TypedEnv, EnumVar } from '@amccarthy1/typed-env'
19+
20+
const env = TypedEnv({
21+
ENVIRONMENT: EnumVar({ options: ['dev', 'staging', 'prod'] }),
22+
})
23+
24+
doWhateverToRunApp(env.ENVIRONMENT) // env.ENVIRONMENT is of type 'dev' | 'staging' | 'prod'
25+
```
26+
727
## Why is this useful
828

929
Many services use environment variables for runtime configuration, anything from the current

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
"name": "@amccarthy1/typed-env",
33
"version": "1.1.1",
44
"description": "Typed environment variables",
5-
"main": "dist/cjs/src/index.js",
6-
"module": "dist/esm/src/index.js",
7-
"umd:main": "dist/umd/src/index.js",
8-
"types": "dist/types/src/index.d.ts",
5+
"main": "dist/cjs/index.js",
6+
"module": "dist/esm/index.js",
7+
"umd:main": "dist/umd/index.js",
8+
"types": "dist/types/index.d.ts",
99
"scripts": {
1010
"prepublishOnly": "pinst --disable",
1111
"postpublish": "pinst --enable",

0 commit comments

Comments
 (0)