Gathering detailed insights and metrics for ey
Gathering detailed insights and metrics for ey
Gathering detailed insights and metrics for ey
Gathering detailed insights and metrics for ey
ey-template-vue3
vue3代码生成器
ey-activiti-designer
A activiti designer base bpmn-js and bpmn-js-properties-panel
redux-ey
`npm install redux-ey --save`
ey-calendar
This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
Ey is an ergonomic and fast server+router, built on uWebSockets.
npm install ey
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
Unlicense License
36 Stars
256 Commits
6 Forks
5 Watchers
1 Branches
1 Contributors
Updated on Jul 08, 2025
Latest Version
2.3.3
Package Id
ey@2.3.3
Unpacked Size
56.52 kB
Size
16.20 kB
File Count
10
NPM Version
10.5.0
Node Version
20.12.2
Published on
May 23, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
Ey is an ergonomic and fast server+router, built on uWebSockets (for now). It has a simple interface embracing todays JS features.
1import ey from 'ey' 2 3const app = ey() 4 5app.get('/', r => r.end('Hello World')) 6 7const { port } = await app.listen(process.env.PORT)
The request object contains all relavant data and methods to handle incoming requests and methods to respond as desired.
1app.get(r => { 2 r // is the request object 3})
.method
The HTTP verb of the request.
.url
Contains the actual url sent by the client
.pathname
Contains the relative url for the specific handler
.headers
An object containing headers. If multiple headers are found the value will be a comma separated list of values.
.query
A URLSearchParams object for the query string. This is a getter so the URLSearchParams object will be created lazily.
.params
An object of the matched routing params like.
/authors/:author/books/:book
= { author: 'Murray', book: 'Ethics of Liberty' }
.body() -> Promise
A function which reads the incoming body and transforms it to an optional type text
or json
. If no type is specificed a Buffer
will be returned.
r.cookie(name) -> Object
Returns an object representing the cookie
.status(status)
.header(name, value) | r.header({ name: value })
.end(body)
.tryEnd(body)
.write()
.cork()
.offset()
.status()
.writable()
.close()
.cookie(name, { ... })
Implement middleware with all
. Ey forwards the request to the next handler, unless a response has begun.
1app.all((r, next) => { 2 r.headers.authorization 3 ? r.token = r.headers.authorization.split(' ')[1] 4 : r.statusEnd(401) // request ends here 5}) 6 7app.all(r => { 8 r.token 9})
There are various ways to optimize your routes by being more specific in their definition.
You can specify which headers a route will use, up front, to prevent reading and loading unnecessary headers. Be aware that this is not possible for route handlers that come after other async handlers.
1const app = ey({ headers: ['content-type'] }) 2 3app.get('/login', { headers: ['authorization'] }, r => { 4 r.headers['content-type'] // string 5 r.headers['authorization'] // string 6 r.headers['accept'] // undefined 7})
Any middleware that accepts 2 arguments will be registrered as an error handler and receive the error as the first argument, and the request object as the second. This will allow you to log errors and reply accordingly. If no error handler makes a response the default error handler will reply with 500 Internal Server Error
and call console.error
.
1app.all((error, r) => { 2 connected = true 3 res.end(await ...) 4})
Routes are matched according to the order in which they are defined. This is important to support middleware with less specific route matching.
hej | med | yo |
---|---|---|
/user | will only match requests to the url /user |
/user*
All requests that begins with /user
/user/*
All requests that begins with /user/
*/user
All requests that ends with /user
/user
All requests with one path segment, setting
r.params = { user }
/:user/posts/:post
All requests with 3 segments that has
posts
in the middle, settingr.params = { user, post }
1// GET /u25 2app.get('/:id', r => 3 r.params.id // The actual id value 4)
1// GET /?sort=-price 2app.get(r => { 3 req.query.sort // -price 4})
1// POST /user { name: 'Murray' } 2app.post('/user', async r => { 3 const body = await r.body('json') 4 , user = await sql`insert into users ${ sql(body) }` 5 6 r.json(user, 201) // r.json sets Content-Type: application/json header 7})
1app.get('/favicon.ico', r => r.file('/public/favicon.ico'))
1app.all('/node_modules', r.files('/node_modules'))
1// POST /file data 2app.post('/file', async r => { 3 await new Promise((resolve, reject) => 4 r.readable.pipe(fs.createWriteStream('...')) 5 .on('finish', resolve) 6 .on('error', reject) 7 ) 8 r.end('Done') 9})
1// GET /old-link 2app.get('/old-link', async r => { 3 r.statusEnd(302, { location: '/new-link' }) 4})
1app.all(r => { 2 const session = await sql`select * from sessions where key = ${ 3 r.headers.authorization.split(' ')[0] 4 }` 5})
Ey simplifies the express routing model, by removing request
and next
.
1undefined
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
no SAST tool detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More