
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
const {route}=require("obyek")
class App extends route("/"){
constructor(){
super()
this.listen(3000)
}
get(req,res){
res.send("Hello world")
}
}
new App()
this is a rather opinionated framework. but maybe it can't be called opinionated nor can it be called unopinionated. that's because some libraries for doing things that are usually installed separately are available by default. using the OOP paradigm to make grouping easier and more
npm i obyek
const {route}=require("obyek")
class App extends route("/"){
constructor(){
super()
this.listen(3000)
}
get(req,res){
res.send("Hello world")
}
}
new App()
const {route}=require("obyek")
class Foo extends route("/foo"){
get(req,res){
res.send("Foo")
}
}
class Bar extends route("/bar") {
get(req,res) {
res.send("Bar")
}
}
class App extends route("/") {
constructor() {
super()
this.childRoute(new Foo())
.childRoute(new Bar())
.listen(3000)
}
get(req,res) {
res.send("Hello world")
}
}
new App()
const {route}=require("obyek")
class App extends route("/") {
constructor() {
super()
//relative to current route path
this.app.all("/",(req,res,next)=>{
console.info("all")
next()
})
this.app.post("/",(req,res,next)=>{
console.info("post")
next()
})
this.listen(3000)
}
get(req,res) {
res.send("Hello world")
}
post(req,res){
res.json(req.body)
}
}
new App()
const {logger}=require("obyek")
//winston
logger.info("hello")
const {route,config}=require("obyek")
//default
config({
logDirName:"log",
notFoundMiddleware:(req,res)=>{
res.status(404)
res.json({
status:"error",
message:"not found",
error:{
detail:`cannot ${req.method} ${req.url}`
}
})
},
errorMiddleware:(err,req,res,next)=>{
console.error(err)
res.status(500)
res.json({status:"error",message:"internal server error",
error:{detail:err.stack}})
}
})
class App extends route("/"){
get(){
throw new Error("error")
}
//config method is called after listen method
config(cnfg){
//default
//set to false to disable middleware
cnfg.json={}
cnfg.cors = false //{}
cnfg.helmet=false //{}
cnfg.compression=false //{}
cnfg.urlencoded={
extended:false
}
cnfg.cookieParser=[] //[secret,options]
cnfg.static = false //[root,options]
}
}
new App().listen(3000)
const {route,testRequest} = require("obyek")
class App extends route("/"){
get(req,res){
res.send("testing")
}
}
//i assume you are using jest
test("example test",async ()=>{
expect((
await testRequest(new App())
.get("/")
).text).toBe("testing")
})
The obyek project welcomes all constructive contributions. Contributions take many forms, from code for bug fixes and enhancements, to additions and fixes to documentation, additional tests, triaging incoming pull requests and issues
FAQs
web framework
We found that obyek 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.