
Security News
npm Tooling Bug Incorrectly Marks One-Character Packages as Security Holders
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.
fastify-typeorm-plugin
Advanced tools
Fastify plugin for TypeORM for sharing the same TypeORM connection in every part of your server. Under the hood the official TypeORM module is used.
npm install fastify-typeorm-plugin
Add it to your project with register and you are done!
The plugin accepts the same connection options as the TypeORM client.
const fastify = require('fastify')();
const user = require('./entity/user');
fastify.register(require('fastify-typeorm-plugin'), {
type: 'sqlite',
database: './mydb.sql',
});
fastify.get('/users', async function(req, reply) {
const users = await this.orm
.getRepository(User)
.createQueryBuilder('user')
.getMany();
return users;
});
fastify.listen(3000, err => {
if (err) throw err;
});
If you won't pass config, it will use typeorm default createConnection mechanism:
const fastify = require('fastify')();
const user = require('./entity/user');
fastify.register(require('fastify-typeorm-plugin'));
fastify.get('/users', async function(req, reply) {
const users = await this.orm
.getRepository(User)
.createQueryBuilder('user')
.getMany();
return users;
});
fastify.listen(3000, err => {
if (err) throw err;
});
You can also pass in an existing connection:
const { createConnection } = require('typeorm');
const fastify = require('fastify')();
const connection = await createConnection({
type: 'sqlite',
database: './mydb.sql',
});
fastify.register(require('fastify-typeorm-plugin'), {
connection,
});
Licensed under MIT.
FAQs
Fastify plugin for typeorm
The npm package fastify-typeorm-plugin receives a total of 20 weekly downloads. As such, fastify-typeorm-plugin popularity was classified as not popular.
We found that fastify-typeorm-plugin 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
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.

Research
/Security News
Newer packages in this compromise use native extensions and .pth loaders to execute JavaScript stealers in developer environments.

Research
Socket found 37 malicious PyPI wheels that abuse Python startup hooks to launch a Bun-powered credential stealer tied to Mini Shai-Hulud/Miasma.