Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@meghjs/data

Latest version: v0.7.1

Overview

Last scanned
23 Nov 2026
Published
23 Nov 2026
npm package Publisher: xtareq
1 Stars
4 Forks
10 Versions
2.1K Downloads
TypeScript Repo language

Scan summary

@meghjs/data was last scanned on 23 Nov 2026 at version 0.7.1. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 10 versions; the latest 3 were published within 6 days (18–23 Nov 2026).
  • Findings: No rules fired in version 0.7.1.
  • Downloads: 2,082 downloads.

Versions

10 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.7.1 LATEST 23 Nov 2026 No rules fired
0.7.0 21 Nov 2026 No rules fired
0.6.5 18 Nov 2026 No rules fired
0.6.3 16 Nov 2026 Not shown
0.6.0 12 Nov 2026 Not shown

No rules fired in 0.7.1

Findings

Findings for v0.7.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.7.1; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

@meghjs/data

TypeORM and Knex integration for Megh.

@meghjs/data is a Megh plugin. Once it is installed, the app gains app.useTypeORM() and app.useKnex(); nothing needs to be imported to enable them.

npm install @meghjs/data typeorm pg   # TypeORM
npm install @meghjs/data knex pg      # Knex

Projects created with megh new load the plugin's types through the generated megh-env.d.ts. In other projects, add the file yourself and include it in tsconfig.json:

// megh-env.d.ts
/// <reference types="@meghjs/data" />

Both methods connect before they resolve, register the connection with the container, and close it when the app shuts down (app.close(), SIGTERM or SIGINT). For a bundled app, which has no package.json to discover plugins from, pass the plugin explicitly:

import { Megh } from "@meghjs/core";
import { dataPlugin } from "@meghjs/data";

const app = Megh.createApplication({ plugins: [dataPlugin] });

Knex

useKnex connects eagerly and verifies the connection, so it returns a promise:

await app.useKnex({
  client: "mysql",
  connection: {
    host: "127.0.0.1",
    port: 3306,
    user: "root",
    password: "password",
    database: "myapp",
  },
});

Using a config class:

import { AppConfig, MeghConfig, Environment } from "@meghjs/core";
import type { Knex } from "knex";

@AppConfig
export class KnexConfig extends MeghConfig<Knex.Config> {
  config(env: Environment): Knex.Config {
    return {
      client: "mysql",
      connection: {
        host: env.get("DB_HOST") || "127.0.0.1",
        port: Number(env.get("DB_PORT")) || 3306,
        user: env.get("DB_USER") || "root",
        password: env.get("DB_PASS") || "password",
        database: env.get("DB_NAME") || "myapp",
      },
    };
  }
}

await app.useKnex(KnexConfig);

Using in a service:

import { AppService } from "@meghjs/core";
import { KnexDB } from "@meghjs/data";

@AppService
export class UsersService {
  constructor(private readonly db: KnexDB) {}

  async findAll() {
    return this.db.client.select("*").from("users");
  }

  async page(page: number) {
    return this.db.paginate(this.db.client("users").orderBy("id"), {
      page,
      perPage: 20,
    });
  }
}

TypeORM

useTypeORM initializes the DataSource, so it returns a promise:

await app.useTypeORM({
  type: "postgres",
  host: "localhost",
  port: 5432,
  username: "postgres",
  password: "password",
  database: "megh",
  entities: [User],
  synchronize: true,
});

Using a config class:

import { AppConfig, MeghConfig, Environment } from "@meghjs/core";
import type { DataSourceOptions } from "typeorm";

@AppConfig
export class DataSourceConfig extends MeghConfig<DataSourceOptions> {
  config(env: Environment): DataSourceOptions {
    return {
      type: "postgres",
      host: env.get("DB_HOST") || "localhost",
      port: Number(env.get("DB_PORT")) || 5432,
      username: env.get("DB_USER") || "postgres",
      password: env.get("DB_PASS") || "password",
      database: env.get("DB_NAME") || "megh",
      entities: [User],
      synchronize: true,
    };
  }
}

await app.useTypeORM(DataSourceConfig);

Injecting a repository. @InjectRepository gives you the TypeORM repository plus a paginate() method:

import { AppService } from "@meghjs/core";
import { InjectRepository, PaginatedRepository } from "@meghjs/data";
import { User } from "./user.entity";

@AppService
export class UserService {
  constructor(
    @InjectRepository(User)
    private readonly userRepo: PaginatedRepository<User>,
  ) {}

  findAll() {
    return this.userRepo.find();
  }

  page(page: number) {
    return this.userRepo.paginate({ page, perPage: 20 });
  }
}

Custom repositories. Extend MeghRepository for pagination, transactions and your own query methods. Query operators (Like, In, Not, Between, IsNull, Equal, ArrayContains, …) are exported from @meghjs/data.

In 0.3.0, give the class an explicit constructor that calls super(), even if it has no dependencies (see Known Issues):

import { MeghRepository, Repository, Like } from "@meghjs/data";

@Repository(User)
export class UserRepository extends MeghRepository<User> {
  constructor(private readonly audit: AuditService) {
    super();
  }

  search(term: string, page = 1) {
    return this.paginate(
      { where: { name: Like(`%${term}%`) } },
      { page, perPage: 20 },
    );
  }

  async rename(id: number, name: string) {
    return this.transaction(async (tx) => {
      await tx.update({ id }, { name });
      await this.audit.log("rename", id);
    });
  }
}

transaction() joins an already active transaction instead of opening a nested one. withManager(manager) returns a copy of the repository bound to another EntityManager.

Pagination

repo.paginate(), MeghRepository.paginate(), KnexDB.paginate() and paginateKnex() return core's unified { data, meta } shape; see Pagination.

License

MIT

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @meghjs/data

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

PolinRider Returns
Research

PolinRider Returns: Hijacked npm Packages Use Ethereum Blockchain to Conceal Malware Infrastructure

Vulnerability Insights

Compromised Claude Code extensions (versions 2.1.312 & 2.1.313) in Cursor try to install a backdoor

Copy of Template Design OX Blog (1)
Research

Thousands Of GitHub Accounts Hijacked With wfx-loot CI Secret Stealing Malware Via GitHub Actions & npm

Frame 2085668439 (1)
Group 1261154229