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

ts-tinkerpop

v1.6.1

Published

Utilities for using Tinkerpop3 via the node-java API in Typescript

Downloads

29

Readme

ts-tinkerpop

A helper library for Typescript applications using TinkerPop 3 via node-java, with a tsJavaModule.ts interface generated by ts-java.

Build Status

Usage

Import the ts-tinkerpop module, giving it a short name of your choice. Do this everywhere you want to use functions from the ts-tinkerpop module.

import TP = require('ts-tinkerpop');

Requirements

  • Java ^1.8.0-31 (1.8.0-40 recommended, see below)
  • Node ^0.12.
  • node-java ^0.5

NOTE: TinkerPop 3 claims to require Java 1.8.0-40. We currently require 1.8.0-31 only because Travis currently uses 1.8.0-31.

Node-java Initialization

ts-tinkerpop takes advantage of a feature in node-java for coordinating application initialization and JVM creation. ts-tinkerpop registers itself on first import using the java.registerClient function. An application using ts-tinkerpop must therefore create the JVM using the corresponding java.ensureJvm function. However, ts-tinkerpop wraps the java.ensureJvm() function in the method TP.getTinkerpop():

import TP = require('ts-tinkerpop');

TP.getTinkerpop().then(() => {
	// ts-tinkerpop and JVM ready to use here.
});

ts-tinkerpop uses Bluebird promises, and configures node-java for just sync functions, with no suffix, and promises, with the suffix 'P':

java.asyncOptions = {
  syncSuffix: '',
  promiseSuffix: 'P',
  promisify: BluePromise.promisify
};

ts-tinkerpop helper functions

All of the ts-tinkerpop helper functions are in the one source file lib/ts-tinkerpop.ts. See the groc generated documentation in doc/lib/ts-tinkerpop.html. See also the unit tests for examples: test/tinkerpop-test.ts.

Coverage of the Tinkerpop Java API

In addition to the helper functions, ts-tinkerpop exposes much of the Tinkerpop 3 Java API.

ts-tinkerpop is currently up to date with the latest release 3.0.1-incubating. Our intent is to track Tinkerpop releases closely. The NPM version of this module will relate to the corresponding TinkerPop version.

ts-tinkerpop currently exposes a significant subset of the Tinkerpop 3 gremlin-core, gremlin-groovy and tinkergraph-gremlin packages. The set of classes exposed largely aligns with the classes automatically imported by the Gremlin Groovy Console (listed by groovy console command :show imports), with the notable exception that ts-tinkerpop currently does not expose any classes from the gremlin-driver package.

See the tsjava section of package.json to see which packages and classes are included in the configuration, or for the full details, run the tsjava tool as follows:

$ ./node_modules/.bin/ts-java --details
ts-java version 1.2.1
Generated classes:
   co.redseal.gremlinnode.function.GlobFunction
   co.redseal.gremlinnode.function.GroovyLambda
   co.redseal.gremlinnode.testing.TestClass
   co.redseal.util.StringInputStream
   groovy.lang.Binding
   groovy.lang.Closure
   groovy.lang.DelegatingMetaClass
   groovy.lang.GroovyClassLoader
   groovy.lang.GroovyCodeSource
   groovy.lang.GroovyObjectSupport
   groovy.lang.GroovyResourceLoader
   ...