
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
express-string-controllers
Advanced tools
Reduce imports in your expressjs apps using a controllers wrapper
npm install express-string-controllers --save
yarn add express-string-controllers
If your folder structure is something like this:
index.ts
import express from 'express';
import App, { IExpress } from 'express-string-controllers';
// wrap your express app
const app: IExpress = new App(express());
app.get('/pets', 'PetsController.getPets');
// Replace with your port number
app.listen(4000, () => {
console.log('app started');
});
PetsController.ts
class PetsController {
static async getPets(req, res, next) {
return res.status(200).json({
pets: ['dog', 'cat']
});
}
};
export default PetsController;
You can also dictate your controllers folder path manually:
index.ts
import path from 'node:path';
import express from 'express';
import App, { IExpress } from 'express-string-controllers';
// wrap your express app
const controllersPath = path.resolve(__dirname, './custom/custom_controller');
const app: IExpress = new App(express(), controllersPath);
app.get('/pets', 'PetsController.getPets');
// Replace with your port number
app.listen(4000, () => {
console.log('app started');
});
PetsController.ts
class PetsController {
static async getPets(req, res, next) {
return res.status(200).json({
pets: ['dog', 'cat']
});
}
};
export default PetsController;
For more examples, check the __tests__ folder.
require
./index.js
const path = require('path');
const express = require('express');
const { App } = require("express-string-controllers");
// controller path
const cPath = path.join(__dirname, './controllers');
// init app
const app = new App(express(), cPath);
// define routes
app.get('/ban', 'PetsController.helloWorld');
app.listen(2000, () => { console.log('server started');
});
./controllers/PetsController.js
// default exports
module.exports = class PetsController {
static async helloWorld(req, res, next) {
return res.send('hello world');
}
}
FAQs
Reduce imports with express wrapper
The npm package express-string-controllers receives a total of 0 weekly downloads. As such, express-string-controllers popularity was classified as not popular.
We found that express-string-controllers 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
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.