
Research
/Security News
DuckDB npm Account Compromised in Continuing Supply Chain Attack
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
ectypes-sequelize
Advanced tools
A ectypes strategy for Sequelize.js - http://www.sequelizejs.com/.
Ectypes can be found at http://github.com/nicholasf/ectypes.js
npm install ectypes-sequelize
Calls to build() and create() on a Sequelize model are supported.
First, create the Sequelize connection and configure it on the ectypes-sequelize strategy. Then load the strategy into ectypes.
var ectypes = require('ectypes');
var sequelize = new Sequelize('ectypes_test', 'nicholas', null);
var ectypesSequelize = require('ectypes-sequelize').setup(sequelize);
ectypes.load(ectypesSequelize);
Once you have defined an ectype for your model:
//the Sequelize model definition
var Project = sequelize.define('Project', {
title: Sequelize.STRING,
description: Sequelize.TEXT
});
//the ectype for the Project model
var projectType = {
Project: {
title: function(){ return Faker.Name.findName() }
}
};
ectypes.add(projectType);
You may then call build() or create() upon it through ectypes to produce the object.
ectypes.Project.create().success(function(project){
console.log(project.id, project.title); //this logs something like 6 'Autumn Medhurst' (using Faker)
});
Use hooks to model associations.
ectypes.plan(
{
Project: {
title: function(){ return Faker.Name.findName() },
description: function(){ return Faker.Lorem.findSentences() },
_hooks: [ 'add a task to a project', function(project, functionName){
if (functionName === 'create'){
Task.create().success(function(task){
project.task = task;
project.save();
});
}
}]
}
});
project = ectypes.Project.build();
mocha --ignore-leaks tests/ectypes-sequelize-test.js
This library was made while working at Moneytribe - http://moneytribe.com.au.
FAQs
a Sequelize.js strategy for eccies.js
The npm package ectypes-sequelize receives a total of 0 weekly downloads. As such, ectypes-sequelize popularity was classified as not popular.
We found that ectypes-sequelize 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
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.