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

@gembera/gef-cli

v1.1.3

Published

When we use `cmake` to build C/C++ projects, we still need some basic command line tools to prepare the environment, recursively copy/delete some folders etc. You may write your shell script for linux. While your team members may suffer under windows. `ge

Downloads

21

Readme

Why gef-cli?

When we use cmake to build C/C++ projects, we still need some basic command line tools to prepare the environment, recursively copy/delete some folders etc. You may write your shell script for linux. While your team members may suffer under windows. gef-cli is originally developped for gef family projects to make our lives easier. Of course, gef-cli could be used anywhere.

How to install gef-cli

Make sure you have at least node.js 14.x installed. It's recommended to use yarn instead of npm.

yarn global add @gembera/gef-cli

You could use above command to install or update gef-cli to the latest version. Once it is successfully installed, yarn will display something like:

yarn global v1.22.19
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...
success Installed "@gembera/[email protected]" with binaries:
      - ginfo
      - genv
      - gcpdir
      - gmkdir
      - grmdir
      - gsync
✨  Done in 0.97s.

How to use?

Basicly, after you install gef-cli, several command line tools are ready to use anywhere.

ginfo

ginfo displays some basic infomation about your system:

$ ginfo 
ginfo v1.0.1
  nodejs: v16.19.1
  platform: darwin
  arch: x64
  cwd: /Users/jacky/workspace/gembera/gef-cli
  user: jacky

Add -e or --env argument to make ginfo display all environment variables.

genv

genv is very powerful to manage complex environment variables. For example:

genv CMAKE_BUILD_TYPE=Debug CMAKE_GENERATOR="MinGW Makefiles" cmake .

It will be very verbose if there are many variables. genv allows to organize them in different config files. Let's say we have three configs:

  • common
PROJECT=my project
  • debug
CMAKE_BUILD_TYPE=Debug
  • release
CMAKE_BUILD_TYPE=Release

They are placed in the env folder

env
 + common
 + debug
 + release

Now you could execute cmake with debug config :

genv gload=env/common,debug cmake .

which equals to

PROJECT="my project" CMAKE_BUILD_TYPE=Debug cmake .

For release version, just replace debug with release:

genv gload=env/common,release cmake .

Of course, you could still override some environment variables with direct KEY=VALUE pairs:

genv gload=env/common,release CMAKE_BUILD_TYPE=Debug cmake .

The above command override CMAKE_BUILD_TYPE=Release to CMAKE_BUILD_TYPE=Debug again.

At many cases, we have to setup different environment variables for different OS. With genv it is pretty easy to do it. For example, We need MinGW cmake generator. We could just add another config with the name common@win32

  • common@win32
CMAKE_GENERATOR=MinGW Makefiles

When you execute

genv gload=env/common,debug cmake .

It will check if there is an OS specific config exists. In this case, env/common has env/common@win32 peer config. It will be loaded automatically. Thus the full command will be expanded as:

PROJECT="my project" CMAKE_BUILD_TYPE=Debug CMAKE_GENERATOR="MinGW Makefiles" cmake .

Execute ginfo to get your platform name. For MacOS, it will be darwin. You could create

  • common@darwin
CMAKE_GENERATOR=Xcode

In this case, the full command will be

PROJECT="my project" CMAKE_BUILD_TYPE=Debug CMAKE_GENERATOR=Xcode cmake .

Moreover, you could manually assign a platform name via gplatform environment variable:

genv gplatform=stm32 ginfo

The result will be something like:

$ genv gplatform=stm32 ginfo
genv v1.0.2
  command: gplatform=stm32 ginfo
ginfo v1.0.2
  nodejs: v16.19.1
  platform: stm32
  arch: x64
  cwd: /tmp
  user: jacky

genv could be nested, the environment variables will be merged in order:

$ genv K1=1 genv K2=2 K1=100 printenv K1
genv v1.0.2
  command: K1=1 genv K2=2 K1=100 printenv K1
genv v1.0.2
  command: K2=2 K1=100 printenv K1
100

gmkdir {dir1} {dir2} ...

gmkdir creates a any deep directory relative to current work directory.

$ cd /tmp
$ gmkdir build/debug build/release
gmkdir v1.0.1
  mkdir /tmp/build/debug
  mkdir /tmp/build/release

grmdir {dir1} {dir2} ...

grmdir recursively deletes target directories.

$ cd /tmp
$ grmdir build/debug build/release
grmdir v1.0.1
  rmdir /tmp/build/debug
  rmdir /tmp/build/release

gcpdir {dirFrom} {dirTo}

gcpdir recursively copies all files in dirFrom to dirTo

gsync

gsync is used to copy gembera projects from node_modules to pkgs

Sponsors