
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
eobject is a package designed to quickly and easily create a API from a JavaScript object.
Compatible with all data types, including functions, valid in JavaScript objects, eobject automatically generates Express.js routes.
JSON | Web |
---|---|
![]() | example.com/info - {name:"Test",version: "1.0.0"} example.com/info/name - Test example.com/info/version - 1.0.0 example.com/users - {} example.com/users/add - nothing example.com/users/add?email=johndoe@example.com - johndoe@example.com |
The above is based on the example. |
Functions do work in eobject. Functions, if they have parameters, will pull them from the query string (?firstName=John&lastName=Doe) and send them matched to the parameter names of the function.
Order of the query strings does not matter, but the name of the field/key must exactly match the name of the parameter in the function.
Example:
/users/add?email=example@example.com
- Will Work
/users/add?Email=example@example.com
- Will Not Work
/users/add?mail=example@example.com
- Will Not Work
npm install eobject
eobject.setup(*object*);
app.get();
.app.use(eobject.generator);
app.use('/api',eobject.generator);
object.info.name
should corespond to /info/name
The setup function configures eobject with the object that it should generate routes from. It accepts a JavaScript object and a settings object. The settings object is optional.
const eobject = require('eobject');
var object = {
properties: {
a: "yes",
b: "no"
}
}
var settings = {
debug: true
}
eobject.setup(object,debug)
The generator function is a Express.js middleware function and shouldn't be used directory.
To be used in: app.use(eobject.generator)
or app.use('*PATH*',eobject.generator)
app.use('/api',eobject.generator)
The settings object currently only takes the debug
property.
var settings = {
debug: true
}
eobject.setup(object,debug)
const express = require('express');
const app = express();
const object = {
info: {
name: "Test",
version: '1.0.0'
},
users: {
add: async function(firstName,lastName,email) {
return email
}
}
}
const eobject = require('eobject');
eobject.setup(object);
app.use('/api',eobject.generator)
app.get('*',(req,res)=>{
res.send("404")
})
app.listen(3000, () => {
console.log('server started');
});
FAQs
Generate Express.js routes easily and automatically from a object.
We found that eobject 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.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.