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

noctua-repl

v0.1.5

Published

Interactive programming interface for Noctua (Barista->Minerva).

Downloads

15

Readme

Overview

This is a REPL environment for the Noctua annotation tool. This gets you some nice things:

  1. You don't have to wait until UI functionality makes it into the graph (or some other) editor--if the low-level API is capable of expressing it, you can easily do it in the REPL.
  2. For some operations, it is easier to express them succinctly with commands rather than work with a UI.
  3. An extremely easy way of prototyping new functionality.
  4. Spooky action at a distance.

Usage

Given that you have logged in to a Noctua instance, look at the URL and copy your token (the variable is "barista_token").

Know your target installation well enough to know where your Barista is hiding. Copy that URL down.

You might also need to know your Barista definition--is defaults to "minerva_local".

Should then be as simple as:

npm install
node ./bin/noctua-repl.js --token=xyz321abc987 --server http://127.0.0.1:3400

See the examples section for more information.

Examples

CLI examples

Connect to a local server with:

~/local/src/git/noctua-repl$:) reset && node ./bin/noctua-repl.js --token=123 --server http://localhost:3400

Connection to labs with:

~/local/src/git/noctua-repl$:) reset && node ./bin/noctua-repl.js --token=123 --server http://toaster.lbl.gov:3399 --definition minerva_public_dev

Connect to a local server and dump meta-information to a file using CLI:

~/local/src/git/noctua-repl$:) reset && node ./bin/noctua-repl.js --token=123 --server http://localhost:3400 --definition minerva_local --command "get_meta(); show(response)" > /tmp/foo.txt

Connect to a local server local and dump meta-information to a file using a script:

~/local/src/git/noctua-repl$:) reset && node ./bin/noctua-repl.js --token=123 --server http://localhost:3400 --definition minerva_local --file ./scripts/run-script-test.repl.js > /tmp/bar.txt

REPL examples

Get all of the meta-information for the current instance.

get_meta()

Assign environment to a known model, then add a couple of new individuals to it.

model_id = 'gomodel:taxon_9606-5539842e0000002'
add_individual('GO:0022008')
add_individual(intersection(['GO:0022008', 'GO:0008150']))

Add a new model, which gets the default assignment when done. Then add two new individuals as arguments to a new fact.

add_model()
var r = new_request_set()
r.add_fact([r.add_individual('GO:0022008'), r.add_individual('GO:0008150'), 'part_of'] )
request_with(r)

API/Objects

This is a list of symbols that are defined or used in the REPL/scripting environment beyond what comes with node. Remember that you can do any of the normal things that you might want in this environment--it's just node!

Helpers.

  • 'bbop' the bbop-core package
  • 'us' underscore
  • 'manager' the bbop-rest-manager with bbop-reponse-minerva
  • 'show' function to display objects more intelligently

Auto-variables--these are attempted to be sent after every call.

  • 'token'
  • 'model'
  • 'model_id'
  • 'request_set'
  • 'response'
  • 'query_url'

Class expressions--package class-expression.

  • 'union'
  • 'intersection'
  • 'svf'
  • 'cls'

Manager actions--these are manager functions mapped up to the top-level.

  • 'get_meta'
  • 'get_model'
  • 'add_model'
  • 'save_model'
  • 'add_individual'
  • 'new_request_set'
  • 'request_with'

Bigger fun function macros.

  • 'show_models' show summary information for all current models; can take a single string argument of "id", "title", "deprecated", "modified-p", "contributor", "model-state", or "date" for sorting
  • 'show_response'
  • 'silent' supress/re-enable the display of action results

Limitations/TODOs

We're actually feeling pretty good about this right now. Let us know.