
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@e22m4u/js-repository-mongodb-adapter
Advanced tools
MongoDB адаптер для @e22m4u/js-repository
npm install @e22m4u/js-repository-mongodb-adapter
требует пакет js-repository
Все указанные параметры опциональны:
название | значение по умолчанию |
---|---|
protocol | 'mongodb' |
host | '127.0.0.1' |
port | 27017 |
database | 'database' |
username | undefined |
password | undefined |
Пример:
import {Schema} from '@e22m4u/js-repository';
const schema = new Schema();
// объявление источника
schema.defineDatasource({
name: 'myMongo', // название источника
adapter: 'mongodb', // имя адаптера
// параметры
host: '127.0.0.1',
port: 27017,
database: 'myDatabase',
});
// объявление модели
schema.defineModel({
name: 'user', // название модели
datasource: 'myMongo', // используемый источник
properties: { // поля модели
name: 'string',
surname: 'string',
},
});
// получаем репозиторий по названию модели и создаем запись
const userRep = schema.getRepository('user');
const user = await userRep.create({name: 'John', surname: 'Doe'});
console.log(user);
// {
// id: '64f3454e5e0893c13f9bf47e',
// name: 'John',
// surname: 'Doe',
// }
Запуск контейнера mongo:latest
скриптом setup.sh
./setup.sh
Выполнение тестов
npm run test
MIT
FAQs
MongoDB адаптер для @e22m4u/js-repository
We found that @e22m4u/js-repository-mongodb-adapter demonstrated a healthy version release cadence and project activity because the last version was released less than 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.