getGuaka / Env

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 ;)

About

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

License:MIT License


Languages

Language:Swift 100.0%