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

roxterjs

v0.1.9

Published

O RoxterJS é um framework BACKEND para gerenciar requisições de diferentes verbos HTTPs e possui um mecanismo de rotas baseado no conceito de pastas e subpastas aninhadas.

Readme


✨ Por que usar o RoxterJS?

Roteamento automático baseado em estrutura de pastas (estilo Next.js, porém para backend)
2x mais rápido que Express em cenários de concorrência alta
Zero configuração — apenas crie os arquivos e a rota existe
Cluster nativo via ROXTER_CPUS com round-robin
Suporte pronto para params, query, body e headers


⚡ Comparação com Express

| Recurso | Express | RoxterJS | | ------------------ | ---------------------------------- | -------------------------------- | | Definição de rotas | Manual via código (app.get(...)) | Automática via pastas e arquivos | | Performance | 🟡 Média | 🟢 🚀 2x mais rápido | | Cluster embutido | ❌ Não nativo | ✅ Sim (ROXTER_CPUS) | | Aprendizado | Médio | Fácil e intuitivo | | Filosofia | Flexível | Convenção sobre configuração |


📦 Instalação

npm install roxterjs

🔥 Hello World em 30 segundos

app.js

import Roxter from "roxterjs";
const roxter = await Roxter();
roxter.Start();

Estrutura de pastas

Se a pasta "routes" não existir, ela será criada automaticamente na raiz do projeto ou no caminho definido na variável ROXTER_PATH_ROUTE do arquivo .env. A partir dessa pasta, toda a estrutura de rotas — incluindo os níveis de aninhamento — deve ser organizada conforme o padrão demonstrado.

root_projeto
 ├─ app.js
 └─ src/
    └─ routes/
       └─ api/
          └─ view/
             └─ get.js
             └─ [id]/
                └─ get.js
          └─ form/
             └─ post.js
             └─ [slug]/
                └─ post.js

src/routes/api/view/get.js

export default async function App({ res }) {
  return res.end(
    JSON.stringify({
      name: "RoxterJS",
      version: "0.1.9",
    })
  );
}

Teste:

curl -X GET http://localhost:4444/api/view

🌱 Configuração via .env

| Variável | Descrição | Default | Apontar em Produção | | ------------------- | ------------------------------- | ------- | ------------------- | | ROXTER_MODE | "dev" ou "prod" | dev | ✅ Sim | | ROXTER_PORT | Porta do servidor | 4444 | ❌ Não Obrig. | | ROXTER_PATH_ROUTE | Caminho da pasta raiz das rotas | ./ | ❌ Não Obrig. | | ROXTER_TIMEOUT | Timeout de resposta (ms) | 10000 | ❌ Não Obrig. | | ROXTER_CPUS | Número de workers (0 = auto) | 0 | ❌ Não Obrig. |

Exemplo (.env.test):

ROXTER_MODE=dev
ROXTER_PORT=3000

🧠 Exemplos Rápidos

✅ URL Params ([id])

// src/routes/api/view/[id]/get.js
export default async function App({ res, keys }) {
  const { id } = await keys;
  return res.end(`ID recebido: ${id}`);
}

Teste:

curl -X GET http://localhost:4444/api/view/123456

✅ Query Params

// src/routes/api/view/get.js
export default async function App({ res, params }) {
  const { color } = await params;
  return res.end(`Cor escolhida: ${color}`);
}

Teste:

curl -X GET http://localhost:4444/api/view?param1=a&param2=b

✅ Body (POST)

// src/routes/api/form/post.js
export default async function App({ res, body }) {
  const { id } = await body;
  return res.end(`Recebi o body ID=${id}`);
}

Teste:

curl -X POST http://localhost:4444/api/form \
  -H "Content-Type: application/json" \
  -d '{"id":123456789}'

✅ Body (POST) ([slug])

// src/routes/api/form/[slug]/post.js
export default async function App({ res, body, keys }) {
  const { id } = await body;
  const { slug } = await keys;
  return res.end(`Recebi o body ID=${id} e o SLUG=${slug}`);
}

Teste:

curl -X POST http://localhost:4444/api/form/blog \
  -H "Content-Type: application/json" \
  -d '{"id":123456}'

🔧 Adicionando Headers Globais

roxter.Start({
  setHeaders: [
    { name: "Access-Control-Allow-Origin", value: "*" },
    { name: "Access-Control-Allow-Methods", value: "GET, OPTIONS, POST, PUT" },
  ],
});

🎯 Roadmap

  • [ ] Suporte oficial TypeScript
  • [ ] CLI para criar rotas rapidamente
  • [ ] Hot Reload nativo

🤝 Contribua

Pull Requests são bem-vindos! Reporte bugs ou ideias em: https://github.com/packrd/roxterjs/issues


👨‍💻 Autor

:1st_place_medal: @rodrigobuttura1


📝 Licença

MIT — livre para usar em projetos pessoais e comerciais.