# hyperspeed

> Async and TypeScript compatible Cosmos DB graph client, includes CLI tool

Latest version **0.0.11** (published 2017-05-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install hyperspeed
pnpm add hyperspeed
yarn add hyperspeed
bun add hyperspeed
```

Provides the command `hs`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.11 |
| Published | 2017-05-30 |
| First published | 2017-05-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | jakkaj |
| Maintainers | jakkaj |
| Keywords | Cosmos, DB, Azure, Node, Gremlin, Graph |

## Links

- npm: https://www.npmjs.com/package/hyperspeed
- Repository: https://github.com/jakkaj/Hyperspeed
- Homepage: https://github.com/jakkaj/Hyperspeed#readme
- Issues: https://github.com/jakkaj/Hyperspeed/issues
- npm.io page: https://npm.io/package/hyperspeed

## Dependencies (8)

- [utf8](https://npm.io/package/utf8.md) ^2.1.2
- [dotenv](https://npm.io/package/dotenv.md) ^4.0.0
- [viz.js](https://npm.io/package/viz.js.md) ^1.8.0
- [request](https://npm.io/package/request.md) ^2.81.0
- [commander](https://npm.io/package/commander.md) ^2.9.0
- [inversify](https://npm.io/package/inversify.md) ^4.1.0
- [gremlin-secure](https://npm.io/package/gremlin-secure.md) ^1.0.2
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.10

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [btrz-health-check](https://npm.io/package/btrz-health-check.md) — 474 weekly downloads

## Recent versions

- 0.0.11 (latest) — 2017-05-30
- 0.0.10 — 2017-05-30
- 0.0.9 — 2017-05-30
- 0.0.8 — 2017-05-28
- 0.0.7 — 2017-05-24
- 0.0.6 — 2017-05-24
- 0.0.5 — 2017-05-24
- 0.0.4 — 2017-05-24

## README

# Hyperspeed

A command line tool and Node library for working with Cosmos DB. 

This is a work in progress. Please create [issues](https://github.com/jakkaj/Hyperspeed/issues) if you find bugs / things that could be better. 

![hyperspeed](https://cloud.githubusercontent.com/assets/5225782/26386076/816e855c-4087-11e7-9c1b-740fc56bc116.gif)

## In Node.js apps

Create a .env file in the root of your node app that looks like this:

ENDPOINT=yourdb.graphs.azure.com

PRIMARYKEY=yourkey

DATABASE=graphdb

COLLECTION=somegraphcollection


```javascript
var hyperspeed = require('hyperspeed');

require('dotenv').config();
var conf = {
    'database':process.env.DATABASE,
    'collection':process.env.COLLECTION,
    'endpoint':process.env.ENDPOINT,
    'primayKey':process.env.PRIMARYKEY
};

var s = new hyperspeed(conf);

s.executeAsync('g.V().count()').then((result)=>{
    console.log(JSON.stringify(result));
    process.exit(1);
})
```

## From the command prompt

You can use the CLI to run queries. 

To get started, type ```hs --init```. This will create a .env and sample query file to use. Enter your Cosmos settings in the .env file. 

If you use the -w option the app will keep the connection open and allow you to enter more queries. You can append to a file with ```-s```. 

You can run queries from a file by passing in a file with the ```-f``` parameter. Queries can be multi-line with a blank line to separate the queries. Lines beginning with # are comments and will show in the console output and in the output file if one is set. 

```
#add people
g.addV('person').property('id', 'thomas').property('repo', 'jordo').property('firstName', 'Thomas').property('age', 44)

g.addV('person').property('id', 'mary').property('repo', 'jordo').property('firstName', 'Mary').property('lastName', 'Andersen').property('age', 39)

#adding edge
g.V('thomas').addE('knows').to(g.V('mary'))
```

```
Usage: hs [options]

  Options:

   -h, --help                   output usage information
    -V, --version                output the version number
    -c, --config [configPath]    config file path
    -i, --init                   init a sample config and query source file
    -q, --query [query]          run a gremlin query from the command line
    -f, --file [queryFile]       run queries from a file. Blank line to separate gremlins. #lines for comments.
    -s, --save [saveFile]        save the results to a file -  will append
    -w, --wait                   stay open, wait for more gremlin commands
    -d, --diagram [diagramFile]  create a diagram from a query and save it to the file
```
 
## Create a diagram of your query

Hyperspeed can create a visual diagram of your graph query result and save it to a file in SVG format. 

```hs -w -d /somepath/somefile.svg```

In watch mode, enter your query and it will be graphed. Each successive query will overwrite the previously saved file. 

<img src="https://cloud.githubusercontent.com/assets/5225782/26564750/7719703a-4528-11e7-9730-150669da118a.png" height="480"/>

[full size image](https://cloud.githubusercontent.com/assets/5225782/26564750/7719703a-4528-11e7-9730-150669da118a.png).

---
_Source: https://npm.io/package/hyperspeed · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
