typed-neo4j
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Typed Neo4j

Neo4j driver with customizable schema for vertex and edge.

Example

You should define your schema first.

export interface User {
    username: string;
    name: string;
    created: Date;
}

export interface Post {
    title: string;
    content: string;
    created: Date;
    updated: Date;
}

/** Other Vertex Schema ... */

export interface VertexSchema {
    User: User;
    Tag: Tag;
    Post: Post;
    Forum: Forum;
}

export interface EdgeSchema {
    FOLLOWS: {
        from: User;
        to: User;
        props: {
            since: Date;
        };
    };
    /** Other Edge Schema ... */
}

Then you can use it to create a db session.

const db = new DB<VertexSchema, EdgeSchema>();

Enjoy your typed db.create, db.find, db.update, db.link!

Please see example for more details.

Readme

Keywords

none

Package Sidebar

Install

npm i typed-neo4j

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

16.6 kB

Total Files

6

Last publish

Collaborators

  • jacoblincool