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

@0bdx/srv-api

v0.0.8

Published

A simple JSON API in Node.js which works with Mongo-like databases.

Downloads

37

Readme

@0bdx/srv-api

A simple JSON API in Node.js which works with Mongo-like databases.

∅  Version: 0.0.8
∅  NPM: https://www.npmjs.com/package/@0bdx/srv-api
∅  Repo: https://github.com/0bdx/srv-api
∅  AWS Billing Dashboard: https://eu-central-1.console.aws.amazon.com/billing
∅  App Runner Console: https://eu-central-1.console.aws.amazon.com/apprunner

Running locally

To use port 1234 (instead of 8080, the default):
$ PORT=1234 npm start

AWS billing

All prices here are before tax.

GitHub connections billing

As far as I can tell, ‘GitHub connections’ do not appear on the AWS invoice, and are not charged for.

Bandwidth billing

Bandwidth falls under the year-long free tier, and memory-usage does not seem to be charged-for:

  • Bandwidth $0.000 per GB - data transfer out under the monthly global free tier 0.002 GB = USD 0.00

App Runner billing

App Runner is fairly cheap. You are charged by the hour, with separate charges for the ‘build’ service, and the ‘run’ service. The ‘run’ service is divided into ‘provisioned’ (which I think is “up time”), and a charge for CPU time.

On the free tier, while developing this repo, I recreated the app maybe twelve times, so the ‘build’ charge is much higher than a real app would be:

  • USD0.005 per Mins for AppRunner-Build-mins in EU (Frankfurt) 21 Mins = USD 0.11
  • AWS App Runner - Provisioned - GB-hours - EU (Frankfurt) 8.122 hours = USD 0.07
  • USD0.074496 per vCPU-hour for AppRunner-vCPU-hours:RunService in EU (Frankfurt) 0.004 vCPU-hour = USD 0.00

Note that ‘Automatic deployments’ could cost $1 per application per month.
I did try using these, but didn’t see a charge appear on my bill yet.

Bandwidth billing

Bandwidth falls under the year-long free tier, and memory-usage does not seem to be charged-for:

  • Bandwidth $0.000 per GB - data transfer out under the monthly global free tier 0.002 GB = USD 0.00

CloudWatch billing

There’s a free log-monitoring service called CloudWatch which could probably be switched off (the App Runner console provides logs you can manually refresh):

  • Amazon CloudWatch 0.00 per alarm metric month - first 10 alarm metrics 0.001 Alarms = USD 0.00
  • AmazonCloudWatch EUC1-TimedStorage-ByteHrs First 5GB-mo per month of logs storage is free. 0 GB-Mo = USD 0.00
  • AmazonCloudWatch PutLogEvents First 5GB per month of log data ingested is free. 0 GB = USD 0.

Set up AWS

Set up the GitHub connection

Click ‘GitHub connections’ in the sidebar at https://eu-central-1.console.aws.amazon.com/apprunner.
If this is the first time you’ve used App Runner, it will probably be empty.

Click ‘Create an App Runner service’ at https://eu-central-1.console.aws.amazon.com/apprunner.
Click ‘Source code repository’.
Under ‘Connect to GitHub’, click ‘Add new’.
Wait for a new window to open (disable your popup-blocker browser extension).

  • Connection name: srv-api--cnx
  • GitHub app: Allow AWS to connect to your GitHub account

After clicking ‘Next’, and clicking ‘GitHub connections’ in the sidebar again, you should see srv-api--cnx listed.

Set up the App Runner instance

This app is set to deploy from main, manually (so, pushes to main do not automatically deploy a new version of the service).

Click ‘Create an App Runner service’ at https://eu-central-1.console.aws.amazon.com/apprunner.

  • Repository type: Source code repository
  • Connect to GitHub: srv-api--cnxsrv-apimain
  • Deployment trigger: Manual (or Automatic, which costs $1 per application per month)
  • Configuration file: Configure all settings here
  • Runtime: Nodejs 16
  • Build command: npm install (should only install deps, not †he dev-deps)
  • Start command: npm start (or npm start -- -dvw while debugging)
  • Port: 8080
  • Service name: srv-api-App-Runner-Instance
  • Virtual CPU & memory: 1 vCPU2 GB
  • Health check: Path: / (which MUST respond with a 200 HTTP status)
  • Health check: Interval: 20 (once every 20 seconds is the maximum AWS allows)

…and keep the defaults for all the other settings.
Click ‘Next’ and then ‘Create and deploy’.
w