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

cfgi

v0.8.0

Published

The `cfgi` project is a command runner which enables you to create tasks with synchronous or asynchronous commands, capturing their output live or in a silent mode.

Downloads

4

Readme

cfgi wakatime

The cfgi project is a command runner which enables you to create tasks with synchronous or asynchronous commands, capturing their output live or in a silent mode.

Installation

To use cfgi, you first need to install it. To install cfgi as a local dependency run:

$ npm install cfgi

Usage

After you've installed cfgi, you can use it in your javascript code as follows:

import { task, command, runs, commandLive } from "cfgi";

const options = { silent: false, exclude: "none" };

task(
  "My task",
  () => {}, // setup - executes before runs
  [
    runs("A passing command", () => {
      command("exit 0");
    }),

    runs("A failing command", () => {
      command("exit 1");
    }),
  ],
  options
);

This script will run a passing command and a failing command, printing both commands outputs to the console. If a command fails, the script will continue with the next command.

If you don't want to see the output of the commands, you can set silent parameter to true. If you want to exclude live or sync tasks, you can set exclude parameter to "live" or "sync", respectively.

You can use runs to define a run within a task. A run must always have a return statement within its function body. If it does not have one it will be added automatically.

You can use command to execute a command synchronously using the specified command string.

You can use commandLive to execute a command synchronously and captures live output.

Finally task function represents a task with a setup function and a list of runs. The setup function is executed before runs

Documentation

For detailed documentation, please visit the cfgi jsdoc documentation. Here you will find comprehensive information about the API, including detailed descriptions of the task, runs, command, and commandLive functions, as well as the options object.

The documentation also includes examples of how to use the API, and explanations of the different options available for customizing the behavior of your tasks and commands.

If you have any questions or issues with the documentation, please open an issue on the cfgi GitHub repository.

Author & contributions

The cfgi project is developed by Gerard Hernandez. Contributions are welcome and greatly appreciated. Please fork the repository and create a pull request with your changes. Make sure to add tests for new features and bug fixes. If you have any questions, feel free to open an issue on the repository.

License

This project is licensed under MIT License