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

nowapi-cli

v1.11.2

Published

NowAPI CLI

Downloads

1

Readme

NowAPI - When you need an API Now

CI npm version

Logo

Instantaneously create static HTTPS REST-like API endpoints.

When you don't want to go through all the hassle of setting up a REST API backend, NowAPI is the tool for you.

Use cases:

  • Tutorials
  • Simple static backend API endpoints
  • Learning REST APIs
  • Debugging client software

NowAPI has just been released and therefore subject to change. Your feedback is very welcome, please open an issue.

Overview

  1. Create a new virtual host:

    nowapi host new

    Output:

    ✔ Host created: amethyst-ptarmigan-98
  2. Add endpoints:

    For example, the IMDB movie top 3 as a JSON list of IMDB identifiers:

    nowapi endpoint set amethyst-ptarmigan-98 movies/top3 -b '["tt0111161", "tt0068646", "tt0468569"]'

    Add endpoints for details on each movie:

    nowapi endpoint set amethyst-ptarmigan-98 movie/tt0111161 -b '{"title": "The Shawshank Redemption"}'
    nowapi endpoint set amethyst-ptarmigan-98 movie/tt0068646 -b '{"title": "The Godfather"}'
    nowapi endpoint set amethyst-ptarmigan-98 movie/tt0468569 -b '{"title": "The Dark Night"}'
  3. List endpoints

    nowapi endpoint ls amethyst-ptarmigan-98

    Output:

    ✔ Loading endpoints
    Endpoints on host amethyst-ptarmigan-98:
    - movies/top3
      https://nowapi.vercel.app/api/hosts/amethyst-ptarmigan-98/movies/top3
    - movie/tt0111161
      https://nowapi.vercel.app/api/hosts/amethyst-ptarmigan-98/movie/tt0111161
    - movie/tt0068646
      https://nowapi.vercel.app/api/hosts/amethyst-ptarmigan-98/movie/tt0068646
    - movie/tt0468569
      https://nowapi.vercel.app/api/hosts/amethyst-ptarmigan-98/movie/tt0468569
  4. Use endpoints

    List movie top-3:

    curl https://nowapi.vercel.app/api/hosts/amethyst-ptarmigan-98/movies/top3

    Output:

    ["tt0111161", "tt0068646", "tt0468569"]

    Get movie by identifier:

    curl https://nowapi.vercel.app/api/hosts/amethyst-ptarmigan-98/movie/tt0068646

    Output:

    {"title": "The Godfather"}

Installation

Homebrew

For macOS there is a Homebrew tap available:

brew tap robvanderleek/nowapi
brew install nowapi

NPX

Using npx, installation is not necessary. You can run NowAPI on a system with NodeJS 18 or higher from the command-line as follows:

npx nowapi-cli@latest -V

this should display the version number of the latest release.

Using npm NowAPI can be installed globally as follows:

npm install -g nowapi-cli

Platform binaries

Binaries for different platforms (Linux, Windows) are available on the latest release page.

Usage

Available commands and options can be listed by running the tool:

nowapi

It's necessary that you authorize NowAPI to interact with the NowAPI backend. This can be done by logging in as described below.

Login

nowapi login

Cope the code and open the web page.

Logout

nowapi logout

Hosts

Create a new virtual host

nowapi host new

Lists your virtual hosts

nowapi host ls

Delete new virtual host

nowapi host rm amethyst-ptarmigan-98

Endpoints

Create a new endpoint

nowapi endpoint set amethyst-ptarmigan-98 movie/tt0111161 -b '{"title": "The Shawshank Redemption"}'

Lists endpoints on a virtual host:

nowapi endpoint ls amethyst-ptarmigan-98

Delete endpoint on a virtual host:

nowapi endpoint rm amethyst-ptarmigan-98 movie/tt0111161

Feedback, suggestions and bug reports

Please create an issue here: https://github.com/robvanderleek/nowapi/issues

Contributing

If you have suggestions for how create-issue-branch could be improved, or want to report a bug, open an issue! All and any contributions are appreciated.

License

ISC © 2023 Rob van der Leek [email protected] (https://twitter.com/robvanderleek)