Skip to content
/ Env Public

A simple and POSIX compliant library to read and write environment variables

License

Notifications You must be signed in to change notification settings

getGuaka/Env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Env

Build Status codecov Platform Language: Swift Carthage

Why?

If you are developing cross platform command line apps, you need an easy way to interact with the environment variables. Env provides just that.

You can use Env with Guaka to create aweseome command line applications.

Usage

// Set an enviroment variable
Env.set("key1", "value1")

// Get an environment variable
Env.get("SomeKey")

// Clear all variables
Env.clear()

// Get all keys and values
Env.keys()
Env.values()

Installation

You can install Env using Swift Package Manager (SPM) or Carthage.

Swift Package Manager

Add Env as dependency in your Package.swift.

import PackageDescription

let package = Package(name: "YourPackage",
    dependencies: [
        .package(url: "https://github.com/getGuaka/Env.git", from: "0.0.0"),
    ]
)

Carthage

github "getGuaka/Env"

Tests

Tests can be found here.

Run them with

swift test

Contributing

Just send a PR! We don't bite ;)