
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.
@wearemanic/express-base
Advanced tools
Common/shared configuration for Express & MongoDB.
npm install --save @wearemanic/express-base
import { config } from 'dotenv';
import createApp from '@wearemanic/express-base';
import * as schemas from './schemas/index.js';
config();
createApp({ env: process.env, schemas }).listen(3000)
The following configuration is available:
import { config } from 'dotenv';
import createApp from '@wearemanic/express-base';
import fs from 'fs'
import path from 'path'
import * as url from 'url'
import * as schemas from './schemas/index.js';
config();
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
const options = {
env: process.env,
staticDirectory: path.resolve(__dirname, '../dist'),
apiRoot: '/api',
trustProxy: true,
httpsRedirect: true,
middleware: {
cors: {
origin: '*'
...
},
morgan: {
format: 'combined',
options: { ... }
},
json: {
limit: '50mb',
...
}
},
schemas: { ... }
}
createApp(options).listen(3000)
createApp
accepts a schema definition object (schemas
), which it then uses to dynamically create MongoDB collections for each datatype. After instantiating each collection, it then generates API endpoints for managing them.
import { config } from 'dotenv';
import createApp from '@wearemanic/express-base';
config();
const User = {
name: 'String',
email: 'String',
age: 'Number'
}
const Session = {
user: {
type: 'ObjectId',
ref: 'User'
},
location: 'Mixed'
date: {
type: 'Date',
default: Date.now
}
}
createApp({
env: process.env,
schemas: { User, Session }
}).listen(3000)
The above will generate the following routes:
Collection: USER
GET : `/api/users`
GET : `/api/users/:id`
POST : `/api/users`
PUT : `/api/users/:id`
DELETE : `/api/users/:id`
Collection: SESSION
GET : `/api/sessions`
GET : `/api/sessions/:id`
POST : `/api/sessions`
PUT : `/api/sessions/:id`
DELETE : `/api/sessions/:id`
FAQs
Common/shared configuration for Express.
The npm package @wearemanic/express-base receives a total of 0 weekly downloads. As such, @wearemanic/express-base popularity was classified as not popular.
We found that @wearemanic/express-base demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.