No description
Find a file
George Lemon 55da5adaec bump | update semver#head
Signed-off-by: George Lemon <georgelemon@protonmail.com>
2023-05-10 04:27:31 +03:00
.github/workflows Update docs.yml 2023-01-25 22:40:14 +02:00
src bump | update semver#head 2023-05-10 04:27:31 +03:00
tests bump | update semver#head 2023-05-10 04:27:31 +03:00
.gitignore Initial commit 2022-06-13 13:38:35 +03:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2022-07-26 16:18:47 +03:00
LICENSE Create LICENSE 2022-06-15 17:14:39 +03:00
pkginfo.nimble bump | update semver#head 2023-05-10 04:27:31 +03:00
README.md Update README.md 2022-07-26 00:43:04 +03:00


📦 A tiny utility package to extract Nimble information from any .nimble project

😍 Key Features

  • Enable features by a specific dependency 🎉
  • Enable Backwards Compatibility support
  • Magically when requires "pkg_name"
  • Extract all package dependencies (direct + indirect)
  • Cache metadata in pkginfo.json in Current Working Project
  • Meta-programming powered by Nim's Macros 👑
  • Open Source | MIT License

Installing

nimble install pkginfo

Examples

Get nimble meta data from current working project

import pkginfo

static:
    echo pkg().getVersion
    echo pkg().getDescription

Use requires macro to determine the current package dependencies and change the way application works.

import pkginfo

when requires "toktok":
    # here you can import additional libraries or modules
    # execute blocks of code or whatever you need

Extract the version of a package from .nimble project for backwards compatibility support

import pkginfo

when requires "toktok":
    when pkg("toktok").getVersion <= v("0.1.1"):
        # backwards compatibility support
    else:
        # code for newer versions

Checking for the current Nim version from main .nimble

when nimVersion() < v "1.6.4":
    {.warning: "You are using an older version of Nim".}

Roadmap

  • Extract deps info
  • Semver support via Semver lib
  • Extend support for Nimble variables
  • Handle indirect deps
  • Cache dependency metadata in a pkginfo.json
  • Add unit tests
  • Test with bigger projects
  • Extract pkg info with nimble dump <pkg> --json
  • Handle local packages (linked with nimble-link)

❤ Contributions

Contribute with code, ideas, bugfixing or you can even donate via PayPal address 🥰

👑 Discover Nim language

What's Nim? Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Find out more about Nim language

Why Nim? Performance, fast compilation and C-like freedom. We want to keep code clean, readable, concise, and close to our intention. Also a very good language to learn in 2022.

🎩 License

Pkginfo is an Open Source Software released under MIT license. Made by Humans from OpenPeep.
Copyright © 2022 OpenPeep & Contributors — All rights reserved.