{"id":25089688,"url":"https://github.com/neo4-js/neo4-js","last_synced_at":"2025-04-15T19:40:59.917Z","repository":{"id":57309839,"uuid":"67054342","full_name":"neo4-js/neo4-js","owner":"neo4-js","description":"Neo4-js is a object-graph mapper for JavaScript and neo4j with full flow-type support.","archived":false,"fork":false,"pushed_at":"2018-09-05T09:26:09.000Z","size":1544,"stargazers_count":19,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-08T03:38:11.019Z","etag":null,"topics":["flow","flowtype","neo4j","nodejs","ogm","orm-library"],"latest_commit_sha":null,"homepage":"https://neo4.js.org","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neo4-js.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-31T16:22:05.000Z","updated_at":"2024-08-25T18:41:58.000Z","dependencies_parsed_at":"2022-09-09T05:41:35.396Z","dependency_job_id":null,"html_url":"https://github.com/neo4-js/neo4-js","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4-js%2Fneo4-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4-js%2Fneo4-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4-js%2Fneo4-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4-js%2Fneo4-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neo4-js","download_url":"https://codeload.github.com/neo4-js/neo4-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249140361,"owners_count":21219281,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flow","flowtype","neo4j","nodejs","ogm","orm-library"],"created_at":"2025-02-07T11:18:39.380Z","updated_at":"2025-04-15T19:40:59.893Z","avatar_url":"https://github.com/neo4-js.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Neo4-js\n\n[![Build Status](https://travis-ci.org/neo4-js/neo4-js.svg?branch=master)](https://travis-ci.org/neo4-js/neo4-js) [![dependencies Status](https://david-dm.org/neo4-js/neo4-js/status.svg)](https://david-dm.org/janpeter/neo4js) [![devDependencies Status](https://david-dm.org/neo4-js/neo4-js/dev-status.svg)](https://david-dm.org/neo4-js/neo4-js?type=dev) [![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n\nNeo4-js is a object-graph mapper for JavaScript and neo4j with full TypeScript support. Neo4-js hides repetitive queries such as the basic CRUD operations to the developer. For best development experience use TypeScript to obtain good autocomplete results.\n\n## Usage\n\nWith neo4-js you are able to quickly define your data model but maintain complete control over your models. The following code snipped shows how you can work with neo4-js.\n\n```\ntype PersonProps = {\n  name?: StringProperty;\n};\n\ntype TaskProps = {\n  title?: StringProperty;\n  done?: boolean;\n};\n\nclass PersonModel extends Model\u003cPersonProps, PersonInstance\u003e {}\nconst Person: PersonModel = new PersonModel(\"Person\");\n\nclass TaskModel extends Model\u003cTaskProps, TaskInstance\u003e {}\nconst Task: TaskModel = new TaskModel(\"Task\");\n\nconst TaskCreatorRelation = relation\n  .from(() =\u003e Person)\n  .to(() =\u003e Task)\n  .via(\"created\");\n\nconst TaskAssigneeRelation = relation\n  .from(Person)\n  .to(Task)\n  .via(\"assigned\");\n\n@model(Person)\nclass PersonInstance extends ModelInstance\u003cPersonProps\u003e {\n  @hasMany(Task, TaskCreatorRelation)\n  tasks: HasManyActions\u003cTaskProps, TaskInstance\u003e;\n\n  @hasMany(Task, TaskAssigneeRelation)\n  assignedTasks: HasManyActions\u003cTaskProps, TaskInstance\u003e;\n}\n\n@model(Task)\nclass TaskInstance extends ModelInstance\u003cTaskProps\u003e {\n  @hasOne(() =\u003e Person, () =\u003e TaskCreatorRelation)\n  creator: HasOneActions\u003cPersonProps, PersonInstance\u003e;\n}\n\n(async () =\u003e {\n  const paul: PersonInstance = await Person.create({ name: \"Paul\" });\n\n  const propsArray: TaskProps[] = [\n    {\n      title: \"Buy milk\",\n    },\n    {\n      title: \"Buy beer\",\n      done: false,\n    },\n  ];\n\n  const tasks: TaskInstance[] = await paul.tasks.create(propsArray);\n})();\n```\n\n## Documentation\n\nThe documentation is not completed yet but you'll find the basics on [neo4.js.org](https://neo4.js.org). Any help is very much appreciated!\n\n## Installing\n\nTo use neo4-js properly you need to add TypeScript to your project. For now we also install `ts-node` so that we are able to run our code without compiling it manually before running.\n\n```\nyarn add -D typescript ts-node\n```\n\nI recommend using the following `tsconfig.json` configuration.\n\n```\n{\n  \"compilerOptions\": {\n    \"module\": \"commonjs\",\n    \"moduleResolution\": \"node\",\n    \"target\": \"ES6\",\n    \"experimentalDecorators\": true,\n  }\n}\n```\n\nYou might also install Docker to quickly create a neo4j database without any further installations. For neo4-js I used the following bash script to start a neo4j instance in docker. To run it you might create a scripts directory and add the following to `neo4j-startup.sh`, make sure you can execute the script with `chmod 777 neo4j-startup.sh` (because why not 777 on my local machine :P).\n\n```\n# REST PORT: 10000\n# BOLT PORT: 10001\necho \"docker run -p 10000:7474 -p 10001:7687 --rm --env=NEO4J_AUTH=none neo4j\"\ndocker run -p 10000:7474 -p 10001:7687 --rm --env=NEO4J_AUTH=none neo4j\n```\n\nThe only runtime dependency you need to start using neo4-js is neo4-js itself.\n\n```\nyarn add neo4-js\n```\n\n## Built With\n\n* [TypeScript](https://www.typescriptlang.org/) - TypeScript is a typed superset of Javascript that compiles to plain Javascript. \n\n## Contributing\n\nFeel free to send a pull request or create an issue for bugs or feature requests.\n\n## Authors\n\n* **Jan Schlacher** - *Initial work*\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneo4-js%2Fneo4-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneo4-js%2Fneo4-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneo4-js%2Fneo4-js/lists"}