Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ts-tinkerpop

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-tinkerpop

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

  • 1.6.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
2
Weekly downloads
 
Created
Source

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
   ...

Keywords

FAQs

Package last updated on 18 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc