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

secretforge

v0.1.0

Published

Automatize o carregamento de segredos de forma segura, flexível e elegante — com suporte a múltiplos métodos de autenticação, tipagem automática e geração de outputs personalizados.

Readme

📦 Secret Forge

Secret Forge é a ponte entre o seu Vault e seus arquivos .env. Automatize o carregamento de segredos de forma segura, flexível e elegante — com suporte a múltiplos métodos de autenticação, tipagem automática e geração de outputs personalizados. Esqueça o copia-e-cola de tokens secretos. Deixe o Vault trabalhar por você. 🔐⚡

NodeJS NPM TypeScript

📄 Objetivo

O objetivo do Secret Forge é facilitar a integração entre aplicações e o HashiCorp Vault, transformando segredos em variáveis de ambiente de forma automatizada e segura. Ele permite configurar templates flexíveis, autenticar via diferentes métodos (token, AppRole, Kubernetes, GitHub) e gerar arquivos .env e .json prontos para uso — tudo isso com validação, tipagem e cache inteligente.


✨ Funcionalidades

  • Autenticação com Vault: Suporte a múltiplos métodos de autenticação (token, AppRole, Kubernetes, GitHub)
  • Template de variáveis de ambiente: Leitura de templates .env.tpl
  • Tipagem automática de segredos: Conversão automática de tipos (string, number, boolean, json)
  • Validação de configuração: Utiliza Zod para validar a estrutura do arquivo de configuração
  • Geração de variáveis e arquivos: Popular process.env automaticamente e feração opcional de arquivos em (.env, .json)
  • Cache inteligente: Requisições otimizadas com cache interno para evitar chamadas repetidas ao Vault
  • Suporte a múltiplos formatos de config: Lê configurações de arquivos .json, .yaml ou .yml
  • Logger customizável: Use seu próprio logger (ex: winston, pino, etc.) ou o console padrão

💡 Roadmap Futuro

  • Adicionar autenticação via AWS

⚙️ Instalação

npm install secretforge -S

🤓 Exemplo de uso

Arquivo .env.tpl

# .env.tpl
JSON={ "path": "/kv/data/example", "key": "JSON","type": "json" }
NUMBER={ "path": "/kv/data/example", "key": "NUMBER","type": "number" }
BOOL={ "path": "/kv/data/example", "key": "BOOL","type": "boolean" }
PASSWORD=/database/creds/mysql-dev#password
USERNAME=/database/creds/mysql-dev#username

Simple

import { VaultEnvManager } from 'secretforge'

async function main() {
    const loader = new VaultEnvManager({
        vault: {
            address: "http://vault.local",
            auth: {
                method: 'token',
                token: '123',
            }
        },
        output: {
            processEnv: true,
            file: {
                env: {
                    enable: true,
                    path: `.env`
                },
                json: {
                    enable: true,
                    path: `env.json`
                }
            }
        }
    });
    await loader.loadFromTemplate(`.env.tpl`);
}

main().catch(console.error);

Config From yaml file

# vault-config.yaml

vault:
  address: http://vault.local
  auth:
    method: token
    token: 123

output:
  processEnv: true
  file:
    env:
      enable: true
      path: '.env'
import { VaultEnvManager } from 'secretforge'

async function main() {
    const loader = VaultEnvManager.fromConfigFile(`vault-config.yaml`);
    await loader.loadFromTemplate(`.env.tpl`);
}

main().catch(console.error);

Config

| Parâmetro | Tipo | Obrigatório | Descrição
| ----------- |----------|------------- | -------------------------------------- | vault | object | ✅ | Conexão com Vault Valores | output | object | ✅ | Configuração de saida Valores

Vault Connection

| Parâmetro | Tipo | Obrigatório | Descrição
| --------------- | -------- | ------------ | ----------------------------------- | address | string | ✅ | URL de conexão com vault
| auth | object | ✅ | Metodos de autenticação Valores | version | string | ❌ | Versão do KV default: v1 | resilience | object | ❌ | Opções de resiliencia Valores

Vault Resilience

| Parâmetro | Tipo | Obrigatório | Descrição
| --------------- | -------- | ------------ | ----------------------------------- | retries | number | ✅ | Número de retentativas default: 3 | backoff | number | ✅ | Tempo de espera em cada tentativa default: 1000ms | timeout | number | ✅ | Timeout de requisições

Vault Auth

| Parâmetro | Tipo | Obrigatório | Descrição
| --------------- | -------- | ----------- | ----------------------------------- | method | string | ✅ | Tipo de autenticação (token, github, approle, kubernetes) | token | string | ✅|❌ | Token disponivel somente method de autenticação (token, token) | roleId | string | ❌ | RoleId disponivel somente method de autenticação (approle) | role | string | ❌ | Role disponivel somente method de autenticação (approle) | jwt | string | ❌ | Jwt disponivel somente method de autenticação (kubernetes) | secretId | string | ❌ | SecretId disponivel somente method de autenticação (kubernetes)

Output

| Parâmetro | Tipo | Obrigatório | Descrição
| --------------- | -------- | ------------ | ----------------------------------- | processEnv | bool | ✅ | Habilitar saida de dados via process.env | file | object | ❌ | Opções de Geração de Arquivos Valores

File

| Parâmetro | Tipo | Obrigatório | Descrição
| ------------ | -------- | ------------- | ----------------------------------- | env | object | ❌ | Habilitar geração de arquivo .env Valores
| json | object | ❌ | Habilitar geração de arquivo .json Valores

File Options

| Parâmetro | Tipo | Obrigatório | Descrição
| ------------ | -------- | ------------- | ----------------------------------- | enable | object | ✅ | Habilitar geração de arquivo
| path | object | ✅ | Path de saida do arquivo gerado


📫 Contribuições

Sinta-se à vontade para abrir issues ou enviar pull requests. Sugestões são sempre bem-vindas!


🤓 Contato

Desenvolvido por: Ismael Alves 🤓🤓🤓