
Research
Security News
Malicious npm Packages Target BSC and Ethereum to Drain Crypto Wallets
Socket uncovered four malicious npm packages that exfiltrate up to 85% of a victimβs Ethereum or BSC wallet using obfuscated JavaScript.
Fastlane is a fast and flexible API framework for Node.js. It automatically creates Express routes from your project's file structure, making it easy to build APIs quickly and efficiently.
Zero to API in seconds flat. No speed limits.
Fastlane is a lightning-fast, zero-config Express router that lets you build APIs at breakneck speed. Stop wasting time with boilerplate and start shipping routes that matter.
npm install fastlane
# or
yarn add fastlane
// routes/users.route.ts
import { Request, Response } from "express";
export default {
// GET /users
GET: (req: Request, res: Response) => {
return { users: [{ id: 1, name: "Speed Racer" }] };
},
// POST /users
POST: (req: Request, res: Response) => {
return { id: 2, name: req.body.name };
}
};
import express from "express";
import { attachRoutes, appErrorHandler } from "fastlane";
const app = express();
app.use(express.json());
// Automatically discovers and attaches all route files
app.use(attachRoutes("./routes"));
// Handle errors with our built-in error handler
app.use(appErrorHandler);
app.listen(3000, () => {
console.log("Server racing on port 3000");
});
Fastlane scans your project for files ending in .route.ts
or .route.js
and automatically creates Express routes based on the file path and exported HTTP method handlers.
For example:
users/route.ts
becomes /users
users/admin/route.ts
becomes /users/admin
All route handlers automatically format your responses:
// Return an object
return { user: { id: 1 } };
// Becomes: { user: { id: 1 }, success: true }
// Return an array
return [1, 2, 3];
// Becomes: { data: [1, 2, 3], success: true }
// Return nothing
return;
// Becomes: { success: true }
Fastlane includes a powerful error handling system:
import { StatusError, Unauthorized } from "fastlane";
// Throw custom errors
throw new StatusError("Something went wrong", { statusCode: 400 });
// Or use built-in error types
throw new Unauthorized("Invalid API key");
Zod validation errors are automatically formatted and returned as 400 responses.
attachRoutes(directory: string): Router
Scans the specified directory for route files and returns an Express router with all routes configured.
StatusError
- Base error class with customizable status codeUnauthorized
- 401 Unauthorized errorsNotProcessed
- 403 Forbidden errorsWhen you need to move fast without breaking things, Fastlane gives you the perfect balance of convention and flexibility. No unnecessary abstractions, just pure speed for your API development.
ISC
FAQs
Fastlane is a fast and flexible API framework for Node.js. It automatically creates Express routes from your project's file structure, making it easy to build APIs quickly and efficiently.
The npm package fastlane receives a total of 198 weekly downloads. As such, fastlane popularity was classified as not popular.
We found that fastlane 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.
Research
Security News
Socket uncovered four malicious npm packages that exfiltrate up to 85% of a victimβs Ethereum or BSC wallet using obfuscated JavaScript.
Security News
TC39 advances 9 JavaScript proposals, including Array.fromAsync, Error.isError, and Explicit Resource Management, which are now headed into the ECMAScript spec.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.