
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@deessejs/collections
Advanced tools
High-level abstraction layer built on top of Drizzle ORM.
# Install collections
npm install @deessejs/collections
# Or using pnpm
pnpm add @deessejs/collections
# Or using yarn
yarn add @deessejs/collections
import { collection, field, f } from '@deessejs/collections'
// Define a collection
const users = collection({
slug: 'users',
fields: {
name: field({ fieldType: f.text() }),
email: field({ fieldType: f.text() })
}
})
Execute custom logic at each stage of database operations:
const users = collection({
slug: 'users',
fields: {
name: field({ fieldType: f.text() }),
email: field({ fieldType: f.text() })
},
hooks: {
beforeCreate: [async (context) => {
// Validate or transform data before creating
context.data.email = context.data.email.toLowerCase()
}],
afterCreate: [async (context) => {
// Handle post-creation logic
console.log(`Created user: ${context.result.id}`)
}]
}
})
| Hook | Description |
|---|---|
beforeOperation | Runs before any operation |
afterOperation | Runs after any operation |
beforeCreate | Runs before create operation |
afterCreate | Runs after create operation |
beforeUpdate | Runs before update operation |
afterUpdate | Runs after update operation |
beforeDelete | Runs before delete operation |
afterDelete | Runs after delete operation |
beforeRead | Runs before read operation |
afterRead | Runs after read operation |
import { f } from '@deessejs/collections'
// Text field
field({ fieldType: f.text() })
// Number field
field({ fieldType: f.number() })
// Boolean field
field({ fieldType: f.boolean() })
// UUID field
field({ fieldType: f.uuid() })
// Timestamp field
field({ fieldType: f.timestamp() })
Create a new collection definition.
const users = collection({
slug: 'users',
name: 'Users',
fields: {
name: field({ fieldType: f.text() })
},
hooks: {
beforeCreate: [async (ctx) => { /* ... */ }]
}
})
Define a field in a collection.
const name = field({
fieldType: f.text(),
optional: false,
default: 'default value'
})
Create CRUD operations for a collection.
import { createCollectionOperations } from '@deessejs/collections'
const operations = createCollectionOperations(
collection,
tableName,
db,
table,
hooks
)
// Create
await operations.create({ data: { name: 'John' } })
// Read
await operations.findMany()
// Update
await operations.update({ where: { id: 1 }, data: { name: 'Jane' } })
// Delete
await operations.delete({ where: { id: 1 } })
Contributions are welcome! Please feel free to submit a Pull Request.
If you discover any security vulnerabilities, please send an e-mail to security@nesalia.com.
MIT License - see the LICENSE file for details.
FAQs
High-level abstraction layer built on top of Drizzle ORM
We found that @deessejs/collections 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.