env_macro 0.1.0

Compile-time environment variable inspection

Readme

env! macro for Cairo

Inspect environment variables at compile time.

Usage

In your Scarb.toml:

[dependencies]
env_macro = "0.1.0"

In your code:

const VERSION: usize = env!("VERSION");

Features

  • Specify a default value if the environment variable is not set:
    const VERSION: usize = env!("VERSION", 1);
    
  • Only numeric values are supported at the moment.

Metadata

Version 0.1.0

Uploaded 10 months ago

License MIT

Size 2.9 KB

Installation

Run the following command in your project dir

scarb add env_macro@0.1.0

Or add the following line to your Scarb.toml

env_macro = "0.1.0"

Monthly downloads

Links

Owners