![Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility](https://cdn.sanity.io/images/cgdhsj6q/production/97774ea8c88cc8f4bed2766c31994ebc38116948-1664x1366.png?w=400&fit=max&auto=format)
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.
Effortlessly craft GraphQL APIs on the Edge, designed to thrive across various JavaScript runtimes.
Effortlessly craft GraphQL APIs on the Edge, designed to thrive across various JavaScript runtimes.
Runtime | Status | Example |
---|---|---|
Cloudflare Worker | :white_check_mark: | cloudflare |
Bun | :white_check_mark: | Bun |
Deno | :white_large_square: Pending | |
Vercel | :white_large_square: Pending | |
Node | :white_large_square: Pending |
EdgeQL supports both Schema-First and Code-First.
import { EdgeQL } from 'edgeql'
const app = new EdgeQL()
const schema = `
type Query {
hello: String
}
`
app.handle(schema, (ctx: Context) => 'world')
export default app
import { EdgeQL } from 'edgeql'
import type { Context } from 'edgeql'
import {
GraphQLSchema,
GraphQLObjectType,
GraphQLString,
} from 'graphql'
const app = new EdgeQL()
const helloworld: GraphQLSchema = new GraphQLSchema({
query: new GraphQLObjectType({
name: 'Query',
fields: {
helloworld: {
type: GraphQLString,
resolve: (parent: any, args: any, ctx: Context, info: any) => {
return 'helloworld, EdgeQL'
},
},
},
})
})
app.handle(helloworld)
export default app
EdgeQL adopts the same middleware style like Koa, middleware are simple functions which return a MiddlewareFunction
with signature (ctx, next). When the middleware is run, it must manually invoke next()
to run the "downstream" middleware.
For example if you wanted to track how long it takes for a request to propagate through EdgeQL by adding an X-Response-Time
header field the middleware would look like the following:
async function responseTime(ctx: Context, next: Next) {
const start = Date.now();
await next();
const ms = Date.now() - start;
ctx.set('X-Response-Time', `${ms}ms`);
}
app.use(responseTime);
The builtin middlewares are,
FAQs
Effortlessly craft GraphQL APIs on the Edge, designed to thrive across various JavaScript runtimes.
The npm package edgeql receives a total of 24 weekly downloads. As such, edgeql popularity was classified as not popular.
We found that edgeql 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
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.