npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nodajpa

v0.0.2

Published

Une implémentation inspirée de JPA pour Node.js, simplifiant la gestion des bases de données relationnelles.

Downloads

16

Readme

🚀 NodaJPA - Un ORM inspiré de JPA pour Node.js

NodaJPA est une implémentation inspirée de JPA en Java, permettant une gestion fluide et intuitive des bases de données relationnelles avec Node.js.

🎯 Fonctionnalités

Mapping des entités comme en JPA
Requêtes simplifiées avec un Entity Manager
Support multi-base de données (PostgreSQL)
TypeScript supporté
Gestion des migrations


📦 Installation

npm install nodajpa

📌 Configuration de la base de données

Après l'installation, configurez votre environnement .env dans votre projet avec les informations suivantes :

NODAJPA_HOST=localhost
NODAJPA_PORT=5432
NODAJPA_USER=postgres
NODAJPA_PASSWORD=pass
NODAJPA_NAME=test_nodajpa

⚠️ Actuellement, NodaJPA ne supporte que PostgreSQL. D'autres bases de données seront ajoutées prochainement.


🚀 Utilisation

1️⃣ Définir une entité

import { Column, Entity, ManyToOne, Table } from "nodajpa";


@Table("genre")
class Genre extends Entity{
    @Column({primary_key:true,autoincrement:true})
    id:number;

    @Column()
    nom:string;

    constructor(id:number,nom:string){
        super();
        this.id = id;
        this.nom= nom;
    }
}


@Table('utilisateur')
class User extends Entity {
    @Column({ name: 'id', primary_key: true, autoincrement: true })
    id: number;


    @Column()
    identifiant: string;

    // JoinColumn est le nom de la foreign Key
    // entity est la classe Entity dont la foreign key fait references
    @ManyToOne({joinColumn:"id_genre",entity:Genre})
    genre:Genre;

    @Column()
    password: string;

    constructor(id: number, identifiant: string, password: string,genre:Genre) {
        super();
        this.genre = genre ?? null;
        this.id = id ?? 0;
        this.identifiant = identifiant ?? '';
        this.password = password ?? '';
    }
}

2️⃣ Configurer la connexion

Après l'installation, configurez votre environnement .env dans votre projet avec les informations suivantes :

NODAJPA_HOST=localhost
NODAJPA_PORT=5432
NODAJPA_USER=postgres
NODAJPA_PASSWORD=pass
NODAJPA_NAME=test_nodajpa

⚠️ Actuellement, NodaJPA ne supporte que PostgreSQL. D'autres bases de données seront ajoutées prochainement.

3️⃣ CRUD avec l’Entity Manager

🔍 Récupérer toutes les entrées

const users = await User.getAll();
console.log(users);

Resultat

[
    [class User extends Entity]{
        id: 1,
        identifiant: 'jean',
        password: 'jean1234',
        genre: [class Genre extends Entity] { 
            id: 1, 
            nom: 'm' 
        }
    },
    [class User extends Entity]{
        id: 2,
        identifiant: 'jeanne',
        password: 'jeanne564',
        genre: [class Genre extends Entity] { 
            id: 2, 
            nom: 'f' 
        }
    }
]

🔍 Récupérer une entrée par clé primaire

const user = await User.getByPrimaryKey(1);
console.log(user);

resultat

[class User extends Entity]{
    id: 1,
    identifiant: 'jean',
    password: 'jean1234',
    genre: [class Genre extends Entity] { 
        id: 1, 
        nom: 'm' 
    }
}

🔄 Sauvegarder une nouvelle entrée

const newUser = new User(0, "JohnDoe", "password123");
await newUser.save();

✏️ Mettre à jour une entrée

newUser.password = "newSecurePassword";
await newUser.update();

❌ Supprimer une entrée

await newUser.delete();

🏗️ Exécuter une requête personnalisée

await User.executeQuery("UPDATE utilisateur SET password = $1 WHERE identifiant = $2", "securePass", "JohnDoe");

🏗️ Architecture

📌 Entity Manager - Gestion des entités et des transactions
📌 Repositories - CRUD simplifié pour chaque entité\


📜 Roadmap

🚧 Le projet est encore en plein développement. De nouvelles fonctionnalités seront ajoutées prochainement ! 🚧


📄 Licence

Ce projet est sous licence MIT.

📌 Auteur : Mamitiana Faneva

📢 Contributions bienvenues ! 🚀