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

redmix

v0.0.8

Published

A fun and friendly Appcelerator Cloud MBaaS command line

Downloads

8

Readme

Redmix Build Status npm version

A fun and friendly Appcelerator Cloud MBaaS command line.

demo

Installation

$ [sudo] npm install redmix -g

Usage

Get all the available commands and options:

$ redmix help

🍷  Redmix  « A fun and friendly Appcelerator Cloud MBaaS command line » v0.0.1
Copyright (c) 2015 by Jeff Haynie.  All Rights Reserved.


  Usage: redmix cmd [options]


  Commands:

    create [options]                  create a data object
    connect <appid> [options]         connect to a cloud app
    query <object> <query> [options]  query objects
    sql <query> [options]             query objects using SQL
    disconnect [options]              disconect from a cloud app
    help [cmd]                        display help for [cmd]

  Options:

    -h, --help     output usage information
    -V, --version  output the version number
    --no-banner    Suppress the banner
    --no-colors    turn of colors in output

Connect to ACS

$ redmix connect 
? API Key: 098s09df8a90s8df09a8s9f8d0a98sdf908asdf
? Username/Email: myusername
? Password: ********************************
Application connected.  You can now make requests for this app.

You can also connect to multiple ACS apps at the same time. To use multiple connections, use the --alias flag when you connect.

The alias should be set to a name that you will later reference on other calls to Redmix using the same flag.

For example, let's say you have 2 different apps:

$ redmix connect 12345 myusername mypass --alias acs1
$ redmix connect 56789 myotheruser mypass --alias acs2 --default

You can use the --default option to indicate the if no default is specified on the command line, to use that specific connection.

Now you can switch easily between different connections:

$ redmix sql "select * from files" --alias acs1
$ redmix sql "select * from files" --alias acs2

Query an Object

Query files which have a name starting with appc and return the oldest one:

$ redmix query Files "name like appc" --order created_at --limit 1

Query files with a more complex example:

$ redmix query Files "name!=foo" "module_version not in 0.1.0" "module_version_sortable > 100" --order=-module_version_sortable --sel module_version,name,module_version_sortable --limit 2 --eval "this.map(function(e){return e.custom_fields.module_version;})"

In the above example, we would see something like:

[
  "1.0.23",
  "1.0.18"
]

Query using SQL

Limited support for basic SQL is supported. Currently, only for SELECT statements.

$ redmix sql "select name, url from Files where name like 'appc' order by url DESC LIMIT 1"

You can delete:

$ redmix sql "delete from foo where name = 'hello'"

You can do limited sql expressions:

$ redmix sql "select count(*) from foo"

You can do some advanced things like group by and order by:

$ redmix sql "select module_name, sum(module_filesize) as size from Files where module_filesize > 0 group by module_name order by size desc LIMIT 1000"

Create an Object

Create a File object from the package.json and add a custom field (filetype):

$ redmix create Files "name=package.json,file=./package.json,filetype=json"

Disconnect

Disconnect from ACS:

$ redmix disconnect

Output Formats

Redmix supports outputting in several different formats by specifying the --output options.

  • text - default output, colorized (if enabled) text
  • json - JSON
  • csv - Comma separated
  • tsv - Tab separated
  • columns - Columns

For example, an advanced query with column output:

$ redmix sql "select module_name, sum(module_filesize) as size from Files where module_filesize > 0 group by module_name order by size desc LIMIT 1000" -o columns --no-banner
SIZE      MODULE_NAME
51053123  appcelerator
542404    appc.salesforce
94613     appc.dashboard
25852     appc.mongo
10413     appc.mysql
9693      appc.stripe
9634      appc.mssql
9515      appc.swagger
7781      com.model
7456      appc.composite
6589      appc.azure
6090      appc.acs

Using as an API

You can use Redmix as a node library as well.

For example, to execute a query you can do something like this:

var redmix = require('redmix');
redmix.sql('select * from foo', {}, function(err,executor,query){
  if (err) {
    console.log('failed:',err);
  }
  else {
    executor(query);
  }
});

Troubleshooting

If you run into an issue, please re-try your request with the --debug flag (on command line). This should print out a little more debugging for things like parsing the SQL, building the ACS request, etc. If you do run into an issue, please open a GitHub issues or even better, submit a pull request.

TODO

See the complete issues list in GitHub issues.

License

Licensed under the Apache Public License, version 2. Copyright (c) 2015 by Jeff Haynie. All Rights Reserved.