Code Monkey home page Code Monkey logo

api-less's Introduction

Synopsis

A utility that implements similar functionality to the unix less utility for observing API endpoints during debugging.

WARNING

This tool can be very load intensive on your server. It will query your server every 40ms by default to keep the data up to date. If your maximum request time is larger than 40ms, you can change the interval by suppying --interval ms on the command line.

Installation

npm install --save api-less

Usage

Your API endpoint is best paired with nodemon so that your server will automatically restart when you save your changes.

Supply a URL to observe and let the utility do its magic:

$ api-less --url http://localhost:3000/api/v1/users/jacksondelahunt

The program is interactive (much like less is) in that you can use single keys to perform actions.

Arrow Up/Down - Scroll up or down the buffer one line at a time.

Page Up/Down - Scroll up or down the buffer one page at a time.

n - Toggle line numbers on or off.

q - Exit the program.

Options

--url string - The fully qualified URL of your endpoint to query.

--interval integer - The number of milliseconds before requerying the URL.

--lines boolean - Display line numbers in output.

Motivation

When building APIs you want to see the object you're exposing. Each time you make a change to your code, you need to query the API again to get the latest version. If you're working with a large object, and the part you're interested in is past the bottom of the screen, you have to scroll each time. This is obviously painful.

Instead, use this tool to observe your API endpoint's output as you change your code, all whilst maintaining your position in the output.

License

MIT

api-less's People

Contributors

sabrehagen avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.