
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
An express wrapper for handling async middlewares, order middlewares, schema validator, and other stuff
async-app
is an express wrapper for handling async middlewares, schema
validation, and other stuff.
npm i --save async-app
import {
badRequest,
createApp,
Opts,
errorMiddleware,
} from 'async-app';
interface User {
email: string;
name: string;
password: string;
}
interface Entities extends BaseEntities {
user: User;
}
const options: Opts = {
};
const app = createApp<Entities>(options);
// No more try/catch, async-app does it for you
const getUserData = async (user: User) => {
const profile = await fetchProfile(user.email);
if (!profile) {
throw badRequest('USER_NOT_FOUND');
}
return { // JSON that will be sent to the client
...profile,
password: undefined
};
};
app.get( // Method
'/user', // Path
'Returns user data', // Summary (optional)
`You must be authenticated!`, // Description (optional)
authenticated(), // Middlewares
req => getUserData(req.user), // Request handler
200, // Success status code (optional)
);
app.use(errorMiddleware); // To translate exceptions into HTTP error responses
FAQs
An express wrapper for handling async middlewares, order middlewares, schema validator, and other stuff
The npm package async-app receives a total of 202 weekly downloads. As such, async-app popularity was classified as not popular.
We found that async-app demonstrated a not healthy version release cadence and project activity because the last version was released 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.