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

cidme-cli

v0.6.1

Published

CLI for CIDME

Downloads

4

Readme

CIDME project banner logo - dual CIDME CLI Implementation QR code - cidme://public/EntityContext/dcb2c99b-2fd2-4bb4-925d-32ff534705f3

CIDME-CLI Implementation CIDME ID/URL: cidme://public/EntityContext/dcb2c99b-2fd2-4bb4-925d-32ff534705f3

CIDME-CLI

JavaScript Style Guide

Node-based CLI for CIDME (ALPHA! INCOMPLETE!). Uses the CIDME-JS package.

Install:

  • Use NPM to install:
    npm install cidme-cli
  • If you wish to install the CLI for use globally do this (as root or sudo):
    npm link cidme-cli
    • NOTE: If you do not link the CLI globally you will have to manually install and/or use the dist/cidme-cli.js script directly.

Basic Usage:

NOTE: If you did not link the CLI globally you will have to adjust the commands below to use the cidme-cli.js script itself.

Get help:

cidme-cli

Create a new CIDME Entity with one Entity Context:

cidme-cli createEntityAndEntityContext

Create a new CIDME Entity with three Entity Contexts:

cidme-cli createEntityAndEntityContext 3

NOTE! - jq is your friend!!! Make it pretty:

cidme-cli createEntityAndEntityContext | jq

Save a new CIDME Entity/Entity Context to a file:

cidme-cli -o test.json createEntityAndEntityContext

View a formatted summary of the contents of the file:

cidme-cli -i test.json viewFile

In the above formatted output, find the CIDME Resource URI of the Entity Context. It will be in the CONTEXTS: section, to the right of - Entity Context:, will be in parenthesis, and will take the form of:

cidme://local/EntityContext/8982874a-b43e-49ce-baa2-d1a1770bf94d

Yours will have a different ID (UUID). Copy this CIDME Resource URI.

Now let's add an Entity Context Data Group to our Entity Context. In order to do so, we need to specify the parent Resource Id, which is what we just copied above.

cidme-cli -p cidme://local/EntityContext/8982874a-b43e-49ce-baa2-d1a1770bf94d -i test.json -o test2.json createResource EntityContextDataGroup

View the formatted summary of the new file:

cidme-cli -i test2.json viewFile

There should now be a - EntityContextDataGroup: section under our Entity Context.

We're starting to clutter things up with all the CreatedMetadata and LastModifiedMetadata entries, but there's an easy way we can strip those out when viewing the file, using the -n option:

cidme-cli -i test2.json -n viewFile

Now let's say we want to create an SQLite database and add our new CIDME Entity to it.

First we need to create a blank DB with the proper structure:

cidme-cli -s test.db initSqliteDb

Next we need to add our CIDME Entity to the DB.

cidme-cli.js -i test2.json -s test.db -u viewFile

Now we want to view our CIDME Entity from the SQLite DB. But what was it's CIDME Resource URI again?

cidme-cli.js -i test2.json -n viewFile

In the formatted output, find the CIDME Resource URI of the Entity. It will be at the top, to the right of Entity:, and will be in parenthesis. It will take the form of:

cidme://local/Entity/5444ca91-b9ba-41ea-87f8-f20d29b1fedc

Yours will have a different ID (UUID). Copy this CIDME Resource URI.

Now let's view our Entity from the SQLite DB. In order to do so, we need to specify the CIDME Entity Id, which is what we just copied above.

cidme-cli -g cidme://local/Entity/5444ca91-b9ba-41ea-87f8-f20d29b1fedc -s test.db view

There it is!

We can actually query the SQLite DB by just the CIDME Entity UUID as well:

cidme-cli -g 5444ca91-b9ba-41ea-87f8-f20d29b1fedc -s test.db view

Generate visual layout graph:

cidme-cli can be used to generate a .dot file, which can be used by graphviz to generate an image (or even a postscript file)!

First generate the .dot file from your CIDME file:

cidme-cli genGraph -i test.json -o test.dot

Then use the dot program to generate an image:

dot -x -Tjpg test.dot -o test.jpg

To generate a postscript file instead:

dot -x -Tps test.dot -o test.ps