
Security News
Meet Socket at Black Hat Europe and BSides London 2025
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.
cloudflare-basics
Advanced tools
[](https://www.npmjs.com/package/cloudflare-basics)
Just the basics and nothing more.
See also:
import { Router, json } from 'cloudflare-basics'
export default {
async fetch(
request: Request,
env: Env,
ctx: ExecutionContext
): Promise<Response> {
const router = new Router<Env>()
router.get('/', async ({ request }) => {
return new Response('Hello World!')
})
router.post('/books', async ({ request }) => {
const data = await request.body<{ foo: string }>()
return json({ data })
})
router.get('/books/:id', async ({ params }) => {
const bookId = params?.id
return json({ bookId })
})
return (
router.handle(request, env, ctx) ??
new Response('Not Found', { status: 404 })
)
},
}
const schema = z.object({
name: z.string(),
})
type schemaType = z.infer<typeof schema>
const MyRoute = withZod<Env, schemaType>(schema, async (options) => {
console.log(options.data) //=> { name: 'test' }
return new Response('ok')
})
router.post('/', MyRoute)
MIT
FAQs
[](https://www.npmjs.com/package/cloudflare-basics)
The npm package cloudflare-basics receives a total of 4 weekly downloads. As such, cloudflare-basics popularity was classified as not popular.
We found that cloudflare-basics 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
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.