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

ideal-postcodes-cli

v0.0.1

Published

Command line tool for Ideal-Postcodes.co.uk

Downloads

5

Readme

Ideal-Postcodes.co.uk CLI

Ideal Postcodes is a simple JSON API to query UK postcodes and addresses. Find out more at Ideal-Postcodes.co.uk

This module provides a CLI which allows real-time log streaming and key information lookup.

The CLI requires global installation (potentially with sudo privileges, depending on your setup).

$ npm install -g ideal-postcodes-cli

The idealpostcodes script will be available in your $PATH, allowing you to perform tasks in your terminal. E.g.

$ idealpostcodes logstream -k <your_key> -s <your_secret>

Typically the CLI will require you to enter your api_key and secret_key. You can store your keys as environment variables to save you from having to look them up everytime.

$ export IDEALPOSTCODES_KEY="<your_key>"
$ export IDEALPOSTCODES_SECRET="<your_secret>"
$ idealpostcodes <command>

Real-Time Log Streaming

The CLI allows you to listen for requests on your key in real-time, which details the request type and what kind of response was provided. This is ideal for integration and debugging.

Start listening to for incoming requests on your key with:

$ idealpostcodes logstream -k <your_key> -s <your_secret>

# -k and -s flags can be omitted if your environment variables are defined

Available options for $ idealpostcodes logstream

$ idealpostcodes logstream --json # Output logs as single line JSON objects
$ idealpostcodes logstream --quiet # Stops meta information such as connection, reconnection or disconnect messages from being written to stdout

Since the CLI writes to stdout, you can pipe the output to perform a range of tasks in your terminal. Some examples...

$ idealpostcodes logstream > idealpostcodes.log # Write the output to a file
$ idealpostcodes logstream | grep 'IP Address' # Write the IP address of incoming requests to console
$ idealpostcodes logstream --json --quiet | script.sh # Process raw JSON logs in a script

Lookup Key Details

You can also quickly check information on your key via your terminal.

$ idealpostcodes info -k <your_key> -s <your_secret>

Documentation

More documentation can be found here

License

MIT