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

peachy-cli

v0.2.3

Published

CLI for cross-platform and cross-datasource querying

Downloads

15

Readme

Peachy :peach:

The cross-platform and cross-data-source query CLI

Currently supported data sources

Future development

The idea behind this tool is to add all of the main and popular data sources. This CLI is basically just an interactive shim over the peacherine module. For instance, development work will start in order to add Postgres as an available data source to query

Installation

$ npm install -g peachy-cli

Usage

$ peachy -h

Output:

  Usage: peachy [options]

  Options:

    -h, --help                          output usage information
    -V, --version                       output the version number
    -s, --datasources                   list available data source types
    -l, --list                          list available connections in config (~/.peachy)
    -t, --test                          test connection
    -c, --connection <connection-name>  connection name (from ~/.peachy)
    -i, --collection <collection-name>  collection to perform the action on
    -f, --filter <filter-json>          filter for searching and updating documents
    -u, --update <update-json>          document update options
    -o, --operation <operation-name>    action to take on data source
    -d, --document <document-json>      the document to insert, update, or delete from a collection
    -q, --query <query>                 query text applicable for certain data sources

  Operations:

    queryCollection (mongodb, documentdb)
      (all)        --collection  target collection
      (documentdb) --query       query to run
      (mongodb)    --filter      filter to search (optional)
    createDocument (mongodb, documentdb)
      (all)        --collection  target collection
      (all)        --document    document to insert
    updateDocuments (mongodb)
      (mongodb)    --collection  target collection
      (mongodb)    --filter      filter to update (optional)
      (mongodb)    --update      update options to apply to doc
    deleteDocuments (mongodb)
      (mongodb)    --collection  target collection
      (mongodb)    --filter      filter to delete (optional)

    Note: RDMBSes take the query param text to run

    Config file setup: running any command will create the 
      base config file. I.e. run "peachy -l" which will list 
      all of the connections in configuration, and if the config 
      file does not exist it will create it at ~/.peachy

Examples

List all available connections (or create a new config file in ~/.peachy)

$ peachy -l

:bulb: If there is not ~/.peachy configuration file then running this will create a base file. This is the recommended workflow so you don't have to manually create the JSON file, and you can just modify it manually after-the-fact

List available data sources

$ peachy -s

Test a connection to any data source

$ peachy -c <connection-name> -t

MySQL, SQL Server, and SQL Azure

$ peachy -c <connection-name> -q "select * from information_schema.tables"

MongoDB

query all documents in the collection

$ peachy -c <connection-name> -i <collection-name>

query with a filter

$ peachy -c <connection-name> -i <collection-name> -f <json-filter>

insert a document in the collection

$ peachy -c <connection-name> -i <collection-name> -o createDocument -d <json-document>

update documents (or a document) in the collection

$ peachy -c <connection-name> -i <collection-name> -o updateDocuments -f <json-filter> -u <json-update-obj>

delete documents (or a document) in the collection

$ peachy -c <connection-name> -i <collection-name> -o deleteDocuments -f <json-filter>

DocumentDB

query documents

$ peachy -c <connection-name> -i <collection-name> -q "select * from c"

insert a document in the collection

$ peachy -c <connection-name> -i <collection-name> -o createDocument -d <json-document>