
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.
mongoose-fixtures-deps
Advanced tools
Simple fixture loader for Mongoose on NodeJS.
Fixtures can be in one file, or divided up into separate files for organisation (e.g. one file per model)
The fixture files must export objects which are keyed by the Mongoose model name, each containing the data for documents within that.
NOTE: Loading fixtures will clear the existing contents of a collection!
FOR EXAMPLE: With the file below, 3 documents will be inserted into the 'User' collection and 2 into the 'Business' collection:
//fixtures.js
exports.User = [
{ name: 'Gob' },
{ name: 'Buster' },
{ name: 'Steve Holt' }
];
exports.Business = [
{ name: 'The Banana Stand' },
{ name: 'Bluth Homes' }
];
You can also load fixtures as an object where each document is keyed, in case you want to reference another document: //users.js var ObjectId = require('mongodb').BSONNative.ObjectID;
exports.User = {
user1: {
_id: new ObjectId(),
name: 'Michael'
},
user2: {
_id: new ObjectId(),
name: 'George Michael',
father: exports.User.user1._id
}
}
var fixtures = require('fixtures');
//Objects
fixtures.load({
User: [
{ name: 'Maeby' },
{ name: 'George Michael' }
]
});
//Files
fixtures.load(__dirname + '/fixtures/users.js');
//Directories (loads all files in the directory)
fixtures.load(__dirname + '/fixtures');
Clone / download from github, and then require in your project:
var fixtures = require('./lib/mongoose-fixtures');
FAQs
Fixture loading for Mongoose on NodeJS
The npm package mongoose-fixtures-deps receives a total of 0 weekly downloads. As such, mongoose-fixtures-deps popularity was classified as not popular.
We found that mongoose-fixtures-deps 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
/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.