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 🙏

© 2024 – Pkg Stats / Ryan Hefner

mogwai

v0.2.6

Published

Object-to-graph mapper for Node.js using Gremlin in Mongoose style (very alpha work)

Downloads

42

Readme

Mogwai

Object-to-graph mapper for Node.js which speaks Gremlin (and also reads .groovy files).

Mogwai tries to abstract interaction with any Tinkerpop's Blueprints compliant Graph databases (ie. TitanDB, Neo4J, OrientDB, FoundationDB, Apache's Giraph, etc.).

Most of the documentation is found in the wiki.

Comments, suggestions and pull requests are welcome.

Twitter: @jbmusso

Installation

$ npm install mogwai

Please refer to grex's documentation first on how to set up your Graph database/Rexster server (ie. you will have to install Gremlin and Batch kibbles).

Note that installing Batch kibble will no longer be necessary in a future version of Mogwai.

Quick start

Connecting

var mogwai = require("mogwai");

var settings = {
  host: "localhost",
  port: 8182,
  graph: "graph",
  client: "titan" // or "rexster"
};

mogwai.connect(settings, function(err, connection) {
  // Start here...
});

Simple Schema Definition

var UserSchema = new mogwai.Schema(
  name: String
);

module.exports = mogwai.model("User", UserSchema)

Documentation

The full documentation is available in the Github wiki.

Overview

Mogwai's API is currently inspired by two libraries:

  • Mongoose (see documentation), a MongoDB modeling library for Node.js, especially for the general design of the library (Schema, Models, plugins, etc.). Hence, some method names in Mogwai are very inspired by MongoDB's method (ie. findById, update, etc.).
  • Bulbflow (see Github repo), "a Python persistence framework for graph databases", especially for all stuff related to loading Gremlin scripts defined in .groovy files.

Mogwai sends Gremlin code/queries via HTTP directly to a Rexster server with the Gremlin extension enabled. Note that Mogwai currently also uses some features from grex, a "Gremlin inspired Rexster Graph Server client", which requires the Batch extension on your Rexster server as well.

Mogwai also aims to be ready for changes coming next year with Tinkerpop 3.0. Mogwai may support Rexpro in the future.

Note that Mogwai is currently developed with TitanDB v0.4.0 only, and hasn't been tested with other Tinkerpop/Rexster compliant databases. Although most features should work, expect some of them to not work at all (ie. the still partially supported indexes). Feel free to fork and send a pull request (see /src/clients if you wish to tweak/implement client classes).

Please be aware that Mogwai is in active development, so changes breaking backward compatibility are very likely to occur as this project evolves to a more mature/stable API.

Mogwai is not considered stable and should not be used in production. Use at your own risk.

Tests

Install development dependencies

$ npm install

then run tests

$ make test

TODO

Features

  • More work on indexes (support more databases)
  • Schema: defining property types, indexes, etc.
  • Validation
  • Hooks (pre and post middlewares)
  • Getters and setters for properties

Misc

  • Write many more tests
  • Performance and optimization

Licence

The MIT License (MIT)

Copyright (c) 2013 Jean-Baptiste Musso

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.