Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Table of contents generated with markdown-toc
Nestely is a NestJs module that integrates Kysely into your NestJs application.
What else does this module do?
Nothing else really. It just provides a way to inject the Kysely instance into your services/controllers/repositories. I created this module just to avoid the same boilerplate code in every NestJs project I create.
This project has been tested with
- Kysely 0.24
- SQLite3
Install the latest version of Nestely using npm:
npm install nestely
In order to configure the module with your NestJs application, you need to import the NestelyModule
into your AppModule
(or any other module).
import { Module } from '@nestjs/common';
import { NestelyModule } from 'nestely';
@Module({
imports: [
NestelyModule.register({
plugins: [new CamelCasePlugin()],
dialect: new SqliteDialect({
database: new SQLite(':memory:'),
}),
isGlobal: true,
}),
// Asynchronous configuration
NestelyModule.registerAsync({
useFactory: () => ({
dialect: new SqliteDialect({
database: new SQLite(':memory:'),
}),
plugins: [new CamelCasePlugin()],
}),
isGlobal: false, // default is true
}),
],
})
export class AppModule {}
Once the module is configured, you can inject the Kysely
instance into your services/controllers/repositories using the @InjectKysely()
decorator.
import { Injectable } from '@nestjs/common';
import { InjectKysely, Kysely } from 'nestely';
import { DB } from './db.interface';
@Injectable()
export class AppService {
// provide the DB interface
constructor(@InjectKysely() private readonly kysely: Kysely<DB>) {}
async findAll(): Promise<void> {
const result = await sql`select 1+1 as result`.execute(this.kysely);
console.log(result); // { rows: [ { result: 2 } ] }
}
}
FAQs
Nestedly is a NestJS Provider for the Kysely query builder
The npm package nestely receives a total of 1 weekly downloads. As such, nestely popularity was classified as not popular.
We found that nestely 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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.