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

hyperspeed

v0.0.11

Published

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

Downloads

6

Readme

Hyperspeed

A command line tool and Node library for working with Cosmos DB.

This is a work in progress. Please create issues if you find bugs / things that could be better.

hyperspeed

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

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.

full size image.