npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@datkt/konanc-config

v5.3.3

Published

Command line utility to read '*.kc' konanc config files to print compiler flags

Downloads

90

Readme

konanc-config

Command line utility to read *.kc konanc config files to print compiler flags.

Installation

$ npm install @datkt/konanc-config -g

Latest Release

Prebuilt binaries for konanc-config are available for download for Linux, Windows, and macOS. They can be downloaded from the latest release page.

Usage

usage: konanc-config: [-hDV] [options] <configs>

where options can be:

  -h, --help                    Print this message
  -D, --debug                   Enable debug output
  -V, --version                 Print program version
  -c, --cflags                  Print compiler flags
  -r, --repos, --repositories   Print repositories
  -l, --libs, --libraries       Print libraries
  -p, --prefix=<path>           Set repositories path prefix (default: 'node_modules/')


Enable debug output by using the '-D, --debug' flag or set the
'DEBUG=konanc-config' environment variable.

Report bugs to <https://github.com/datkt/konanc-config/issues>.

Example

$ konanc-config . --libraries --repos --cflags
-opt -r /home/werle/repos/datkt/konanc-config/node_modules/@datkt -l sodium/sodium -l tape/tape

where . contains a file called package.kc:

repo[] = "node_modules/@datkt"
cflags[] = -opt
require[] = sodium/sodium
library[] = sodium/sodium
library[] = tape/tape

Writing A Config File package.kc

Configuration files for the konanc-config command are in INI or JSON format. Any property can be defined, but currently, the command only supports printing libraries, repositories, and compiler flags. The konanc-config command will recognize package.kc files found in directories by default.

Adding Libraries

A library that should be linked against can be expressed by defining the library variable. This intuitively maps to the -library flag for the konanc command.

library = sodium

or multiple libraries

library[] = sodium
library[] = tape

Adding Repositories

A repository that should be used for searching library (.klib) files can be expressed by defining the repo variable. This intuitively maps to the -repo flag for the konanc command.

repo = "node_modules/@datkt/sodium"

or multiple repositories

repo[] = "node_modules/@datkt/sodium"
repo[] = "node_modules/@datkt/tape"

Adding Compiler Flags

Arbitrary compiler flags can be expressed by defining the cflags variable.

cflags = -opt -verbose

or multiple compiler flags

cflags[] = -opt
cflags[] = -verbose

Requiring Dependency Configuration

Requiring a dependency configuration can be expressed by defining the require variable. Dependencies can be a fully qualified path or relative to a repository.

require = "sodium/sodium"
repo = "./node_modules/@datkt"

or with multiple cependencies

require[] = "sodium/sodium"
require[] = "uint64be/uint64be"

Environment & Global Rariables

Every configuration file gets access to current environment variables exposes to the program. Special __dirname and __filename free floating variables give access to the directory name and file name of the configuration file.

Printing konanc flags

To print flags suitable for the konanc command useful for shell interpolation, invoke the konanc-config command with any combination of the supported flags found in the usage help. Short flags can be used for brevity, like konanc-config -clr library.kc, in place of konanc-config library.kc --cflags --libraries --repos.

Printing Library Flags

To print library flags, use -l, --libs, or --libraries flags.

$ konanc-config library.kc --libs

Printing Repository Flags

To print repository flags, use -r, --repos, or --repositories flags.

$ konanc-config library.kc --repos

Printing Compiler Flags

To print compiler flags, use -c or --cflags flags.

$ konanc-config library.kc --cflags

See Also

  • https://github.com/pkgconf/pkgconf
  • https://github.com/Distrotech/pkg-config

License

MIT