
Security News
US Government Forces Anthropic to Pull Claude Fable Days After Launch
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.
@threew/app
Advanced tools
Modern, lightweight, modular, and scalable backend framework for Node.js, built with TypeScript and zero runtime dependencies.
Modern, lightweight, modular, and scalable backend framework for Node.js, built with TypeScript and zero runtime dependencies.
npm install @threew/app
import { createApp, logger } from '@threew/app';
const app = createApp();
app.use(logger());
app.get('/', (ctx) => {
ctx.res.success({ message: 'Hello from Threew!' });
});
app.listen(3000, () => {
console.log('Server running at http://localhost:3000');
});
const { createApp, logger } = require('@threew/app');
const app = createApp();
app.use(logger());
app.get('/', (ctx) => {
ctx.res.success({ message: 'Hello from Threew!' });
});
app.listen(3000);
Support for all standard HTTP methods:
app.get('/users', handler);
app.post('/users', handler);
app.put('/users/:id', handler);
app.patch('/users/:id', handler);
app.delete('/users/:id', handler);
Access route parameters via ctx.req.params:
app.get('/users/:id', (ctx) => {
const userId = ctx.req.params.id;
ctx.res.json({ userId });
});
Access query parameters via ctx.req.query:
// GET /search?q=node&page=1
app.get('/search', (ctx) => {
const { q, page } = ctx.req.query;
ctx.res.json({ q, page });
});
Flexible middleware system inspired by Koa/Express:
app.use(async (ctx, next) => {
console.log('Before');
await next();
console.log('After');
});
Organize your routes with groups and shared middleware:
app.group('/api/v1', (router) => {
router.get('/users', getUsers);
router.post('/users', createUser);
}, authMiddleware);
Built-in support for:
application/jsonapplication/x-www-form-urlencodedtext/plainapp.post('/data', (ctx) => {
console.log(ctx.req.body);
ctx.res.created(ctx.req.body);
});
Prevent abuse with the built-in rate limiter:
import { rateLimit } from '@threew/app';
app.use(rateLimit({
windowMs: 60000, // 1 minute
max: 100, // limit each IP to 100 requests per windowMs
message: 'Too many requests'
}));
Simple request logging middleware:
import { logger } from '@threew/app';
app.use(logger());
res.success(data): Sends 200 OK with { success: true, data }res.created(data): Sends 201 Created with { success: true, data }res.error(message, code): Sends error responseres.badRequest(message): Sends 400 Bad Requestres.unauthorized(message): Sends 401 Unauthorizedres.forbidden(message): Sends 403 Forbiddenres.notFound(message): Sends 404 Not Foundres.conflict(message): Sends 409 Conflictres.internalError(message): Sends 500 Internal Server ErrorServe static files like HTML, CSS, JavaScript, images, and more:
import { createApp, staticFiles } from '@threew/app';
import path from 'path';
const app = createApp();
// Serve files from 'public' directory
app.use(staticFiles(path.join(process.cwd(), 'public')));
app.listen(3000);
const { createApp, staticFiles } = require('@threew/app');
const path = require('path');
const app = createApp();
// Serve static files from 'public' folder
app.use(staticFiles(path.join(__dirname, 'public')));
app.listen(3000);
app.use(staticFiles(path.join(process.cwd(), 'public'), {
index: 'index.html', // Default file for directories
maxAge: 86400000, // Cache duration in ms (1 day)
etag: true, // Enable ETag header
cacheControl: true, // Enable Cache-Control header
dotfiles: 'ignore', // How to handle dotfiles
lastModified: true, // Enable Last-Modified header
immutable: false, // Add immutable directive to cache
setHeaders: (res, filePath, stat) => {
// Custom headers per file
if (filePath.endsWith('.html')) {
res.setHeader('X-Custom', 'HTML file');
}
}
}));
// Serve from multiple folders (order matters)
app.use(staticFiles(path.join(process.cwd(), 'public')));
app.use(staticFiles(path.join(process.cwd(), 'uploads')));
app.use(staticFiles(path.join(process.cwd(), 'assets')));
import { sendFile } from '@threew/app';
// Serve specific file on route
app.get('/', sendFile(path.join(process.cwd(), 'public', 'index.html')));
app.get('/about', sendFile(path.join(process.cwd(), 'public', 'about.html')));
your-project/
├── public/
│ ├── index.html
│ ├── css/
│ │ └── style.css
│ ├── js/
│ │ └── app.js
│ └── images/
│ └── logo.png
├── src/
└── package.json
MIT
FAQs
Modern, lightweight, modular, and scalable backend framework for Node.js, built with TypeScript and zero runtime dependencies.
The npm package @threew/app receives a total of 0 weekly downloads. As such, @threew/app popularity was classified as not popular.
We found that @threew/app demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.

Security News
A network of 152 Chrome live wallpaper extensions hid ad tracking and made extension-driven traffic look like Google search clicks.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.