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

streetjs

v1.2.8

Published

Production-grade TypeScript backend framework. Native PostgreSQL wire driver, JWT, WebSockets, clustering, runtime input validation, field-level encryption, abuse prevention, moderation & privacy controls. No Express. No pg. No Prisma. Minimal, carefully

Readme


Install

npm install streetjs

Requirements: Node.js ≥ 20, TypeScript ≥ 5.0, and "type": "module" in your package.json.

Renamed from @streetjs/core. The old package still works as a deprecated shim that re-exports streetjs unchanged. See the migration guide.


Quick start

import 'reflect-metadata';
import { streetApp, Injectable, Controller, Get, container } from 'streetjs';
import type { StreetContext } from 'streetjs';

@Injectable()
class GreetingService {
  greet(name: string) {
    return `Hello, ${name}!`;
  }
}

@Controller('/api')
class HelloController {
  private readonly svc = container.resolve(GreetingService);

  @Get('/hello')
  async hello(ctx: StreetContext): Promise<void> {
    ctx.json({ message: this.svc.greet('world') });
  }
}

const app = streetApp({ port: 3000, host: '0.0.0.0' });
app.registerController(HelloController);
await app.listen();
// [street] Listening on http://0.0.0.0:3000
curl http://localhost:3000/api/hello
# {"message":"Hello, world!"}

Scaffold a full project (recommended)

npm install -g @streetjs/cli
street create my-api
cd my-api && npm install && street dev

tsconfig.json

StreetJS uses NodeNext module resolution and decorator metadata:

{
  "compilerOptions": {
    "target": "ES2022",
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "strict": true
  }
}

Features

Everything below ships in the streetjs package — no extra installs.

| Area | Included | |---|---| | Core | HTTP server, router, dependency injection, middleware, typed context, OpenAPI 3.1 generation, exceptions | | Data | Native PostgreSQL wire driver (SCRAM-SHA-256), native MySQL, SQLite, connection pool, repositories, migrations | | Security | JWT, AES-256-GCM sessions, scrypt vault, RBAC, rate limiting, XSS sanitizer, field-level encryption, runtime input validation (zod) | | Realtime | Bounded WebSocket server, Server-Sent Events | | Performance | LRU cache, telemetry (P50/P99), cluster coordinator | | I/O | Streaming multipart uploads, webhook dispatcher |

A first-party ORM (@streetjs/orm), messaging transports, observability, and 19 official signed plugins are available across the ecosystem.


A few essentials

Dependency injection

import { Injectable, container } from 'streetjs';

@Injectable()
class UserService {
  constructor(private readonly db: DatabaseService) {}
}

const svc = container.resolve(UserService);

PostgreSQL (no pg dependency)

import { PgPool, container } from 'streetjs';

const pool = new PgPool({
  host: process.env.PG_HOST, port: 5432,
  user: process.env.PG_USER, password: process.env.PG_PASSWORD,
  database: process.env.PG_DATABASE, maxConnections: 10,
});
await pool.initialize();
container.register(PgPool, pool);

const { rows } = await pool.query('SELECT * FROM users WHERE id = $1', [id]);

Security

import { JwtService, RateLimiter, authMiddleware, requireRoles } from 'streetjs';

const jwt = new JwtService(process.env.JWT_SECRET!);
const token = jwt.sign({ userId: '123', roles: ['admin'] }, '7d');

app.use(new RateLimiter({ windowMs: 60_000, maxRequests: 100 }).middleware());
app.use(authMiddleware);
app.use(requireRoles('admin'));

WebSocket & SSE

import { StreetWebSocketServer, createSse } from 'streetjs';

const wss = new StreetWebSocketServer({ heartbeatIntervalMs: 30_000, maxConnections: 10_000 });
wss.on('connection', (socket) => socket.on('message', (d) => socket.emit('echo', d)));
wss.broadcast('announcement', { text: 'Hello everyone' });

Exceptions — throw from anywhere; StreetJS formats the response:

import { NotFoundException, BadRequestException } from 'streetjs';
throw new NotFoundException('User not found');

Subpath exports (tree-shakeable)

import { streetApp }             from 'streetjs';
import { PgPool }                from 'streetjs/pool';
import { JwtService }            from 'streetjs/security';
import { StreetWebSocketServer } from 'streetjs/websocket';
import { LruCache }              from 'streetjs/cache';
import { ClusterCoordinator }    from 'streetjs/cluster';

Common environment variables

| Variable | Default | Description | |---|---|---| | PORT | 3000 | HTTP port | | PG_HOST / PG_PORT | localhost / 5432 | PostgreSQL connection | | PG_DATABASE / PG_USER / PG_PASSWORD | — | PostgreSQL credentials | | JWT_SECRET | — | JWT signing secret (≥ 32 chars in production) | | SESSION_KEY | — | Session encryption key (≥ 32 chars in production) | | NODE_ENV | development | Runtime environment |


Documentation & links

License

MIT © street contributors