Code Monkey home page Code Monkey logo

runtime_environment's Introduction

runtime_environment

A Rust library to check the operating system at runtime.

Installation

In your Cargo.toml, add the following line under the [dependencies] section:

runtime_environment = "0.1.0"

Usage

This is an example usage someone might do:

use runtime_environment::{is_mac_os, is_windows, is_linux};

fn main() {
    if is_mac_os() {
        println!("Running on macOS");
    } else if is_windows() {
        println!("Running on Windows");
    } else if is_linux() {
        println!("Running on Linux");
    } else {
        println!("Running on an unknown OS");
    }
}

Functions

is_mac_os() -> bool

Returns true if the operating system is macOS.

is_windows() -> bool

Returns true if the operating system is Windows.

is_linux() -> bool

Returns true if the operating system is Linux.

Testing

To run the tests, use the following command:

cargo test

License

This project is licensed under the MIT License.

Replace "0.1.0" with the actual version number of your package when you publish it.

This README.md file provides a clear overview of the library, installation instructions, example usage, and information on the available functions.

Gitpod

In the cloud-free development runtime_environment where you can directly start coding.

You can use Gitpod in the cloud Gitpod Ready-to-Code


Feel free to update the README.md or raise issues if any to enhance the project

runtime_environment's People

Contributors

dhanushnehru avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.