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 🙏

© 2026 – Pkg Stats / Ryan Hefner

restit

v1.0.2

Published

Command line tool for REST APIs (nodejs)

Downloads

11

Readme

Command Line Interface for RESTful APIs

Overview

restit is a command line tool (CLI) for talking to RESTful APIs. It's intended to reduce some of the repetition and verbosity that comes with using general purpose CLI tools such as curl with RESTful APIs.

restit requires npm, the node package manager.

Example

restit get statuses/user_timeline -q 'screen_name:"twitterapi"'

In curl:

curl --get -H "Authentication: Bearer TOKEN" "https://api.twitter.com/1.1/statuses/user_timeline.json" -d "screen_name=twitterapi"

Features

  • API Profiles Stores common API data such as the base url (e.g. https://api.twitter.com/1.1) and headers (e.g. Authorization: ...) in a config file.
  • CSON Objects Uses CoffeeScript Object Notation (CSON), so you don't have to quote everything.
  • JSONPath Transforms the JSON response with XPath like selectors.
  • Pretty JSON Cleaner output and colors.
  • Timing Reports round trip time.

Install

[sudo] npm install restit -g

Usage

Usage: restit <command>

where command is either a http method or a config command.

Configuration

restyle stores configuration information in the user's home directory at $HOME/.restitconf.

Edit Configuration

restit set-config <api> [options]

api     name of the API

Options:
   -u, --url       base url of the API
   -e, --header    add/remove request headers (leave value empty to remove)
   -d, --default   make this the default API

To an entry for Twitter's REST API, add a OAUTH app/bearer token for authentication and mark it as the default.

set-config twitter11 --url https://api.twitter.com/1.1 --header "Authentication: Bearer TOKEN" --header "Accept-Encoding: gzip" --default

Subsequent calls to Twitter's API need not specify the base url or auth token. e.g.

restit get statuses/user_timeline -q 'screen_name:"twitterapi"'

Show Configuration

Use the show-config command to dump the current configuration.

restit show-config

e.g.

twitter:
    url: https://api.twitter.com
twitter11:
    url: https://api.twitter.com/1.1
default:   twitter11

Sending REST Requests

coffee app.coffee get <resource> [options]

resource     resource part of the URL (baseurl/resource). required.
Options:
    -a, --api       the API (from config). if missing, default api is used.
    -d, --data      request body
    -q, --query     query parameters
    -e, --header    request header(s). can be used more than once. empty value deletes header.
    --nopretty      don't run output through prettyjson
    -v, --verbose   verbose output
    --nojson        don't encode body as 'application/json'. uses 'application/x-www-form-urlencoded'
    --nosend        construct the request but don't send it
    --noinfo        no informational output
    --jpath         json path selector (transform JSON response)

More Examples

Froyo APIs

#setup
restit set-config --api froyo --url "http://api.froyo.io" --header "Accept: application/vnd.collection.doc+json"

#invoke
./bin/restit get -a froyo pwd --query "length:30" --jpath "$..password" --noinfo

#result
pecroveswutrurisidecopigijupit

MIT License

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.