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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@helper.js/console

v1.0.0

Published

Uma package desenvolvida para facilitar a vida dos devs.

Readme

helper.console

A Node.js package for running shell commands interactively or programmatically with support for logging, worker threads, and customizable warning controls.

Installation

Install the package via npm:

 npm install helper.console

Features

  • Execute comandos shell programaticamente ou interativamente.
  • Suporte para threads de trabalho para gerenciar a execução simultânea de comandos.
  • Registro configurável em um arquivo fora de node_modules.
  • Controle global de avisos para comandos que exigem muitos recursos ou problemas de permissão.
  • Saída de terminal colorida para melhor experiência do usuário.

Code Usage

Use a classe Console para executar comandos programaticamente:

const { Console } = require('helper.console');

// Cria uma instância com configurações personalizadas
const console1 = new Console()
  .MaxWorkers(3) // Define o máximo de worker/comandos simultâneos (aumenta a carga de processamento)
  .setLogging({ 
    enabled: true, // Ativa o arquivo de log
    location: './logs/command_log.txt', // Define o local e nome do arquivo
    restartable: false // Define se esse arquivo será resetado a cada reinício do console. (Útil em projetos com painel Pterodactyl)
  })
  .warns(true); // Ativa ou desativa os avisos recebidos durante o uso de comandos como: "Este comando pode usar muitos recursos e levar muito tempo para ser executado!"

// Envia um comando para o console (usando a instância criada e seguindo as configurações da mesma)
async function runCommand() {
  const result = await console1.runEntry('ls -la');
  if (result.error) {
    console.error(result.error);
  } else {
    console.log(result.output);
  }
}

runCommand();

Interactive Usage

Inicia uma sessão de console interativa:

const { Console } = require('helper.console');

const console1 = new Console()
  .setLogging({ enabled: true, location: './logs/command_log.txt' })
  .warns(true);

console1.init();

Digite os comandos no prompt interativo. Use exit para fechar a sessão.

Static Method

Execute um comando com as configurações padrão:

const { Console } = require('helper.console');

async function runStaticCommand() {
  const result = await Console.runEntry('echo "Hello, World!"');
  console.log(result.output || result.error);
}

runStaticCommand();

Configuration

  • MaxWorkers(count): Define o número máximo de workers simultâneos (deve ser um número positivo).
  • setLogging(options): Configura o arquivo de log:
    • enabled: Boolean para ativar/desativar o log (default: true).
    • location: Caminho para o arquivo de log (default: command_log.txt).
    • restartable: Se true, limpa o arquivo de log no primeiro uso (default: false).
  • warns(enabled): Ativa ou desativa todos os avisos de comando. true exibe os avisos, false os oculta.

Log File Location

O arquivo de log (padrão: command_log.txt) é criado na raiz do projeto ou no caminho especificado em setLogging. Ele é armazenado fora de node_modules para garantir que os logs persistam entre instalações.

Requirements

  • Node.js >= 14.0.0

License

MIT License. See LICENSE for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request on the GitHub repository.

Support

For issues or questions, open an issue on the GitHub repository.