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

begin-functions

v1.0.0

Published

[ ![Codeship Status for smallwins/fun](https://app.codeship.com/projects/6fbe7f70-21a9-0136-180a-5ea8301d74af/status?branch=master)](https://app.codeship.com/projects/285940)

Downloads

7

Readme

Codeship Status for smallwins/fun

Setup

Preview locally using the staging database tables:

  1. Copy .arc-env-example to .arc-env and get the GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET values from Brian
  2. Install deps by running npm run init
  3. Start a reloading dev server npm start

Dev

Lint the code

npm run lint

Run the tests

npm t

Deploy one lambda to staging

npm run deploy src/html/get-index

Deploy static assets to staging

npm run deploy static

CI

Green builds ship everything to staging

important limits

| aws infra | apps | |------------------------------------------------|----------------------------------------------------------------| | 60 api gateway restapis per region per account | means we can have max 30 apps per region | | 15 total availability zones | 15 zones x 30 apps === 450 apps per account | | 1000 iam roles per account | each app requires 1 iam role; still within 450 | | AWS Orgs lets us create 300 accounts | 450x300 === 13500 max possible apps with default limits |

takes about 2 minutes to provision one app which means at the current limits it will take 9.375 days to get to max capacity

| api gateway operational limits | per min | -------------------------------- | -- | DeleteRestApi | 2 per min | CreateDeployment | 3 per min | GetResources | 150 per min | CreateResource | 300 per min | DeleteResource | 300 per min

Total operations 10 request per second (rps) with a burst limit of 40 requests

deletes are ok because we can queue those by removing from app in the db and adding to a whatever-delete table that has a lambda running on a timer cleaning it out. creates/gets: need to be throttled, ui updated with pending state and resolved with completion and/or timeout. ideally via queue to its global to the system/account.

global infra

Each app is a preprovisioned arc app with:

  • staging.app-name-0x1.fun.begin.com
  • app-name-0x1.fun.begin.com

Static assets are also hosted via two cloudfront distributions:

  • static.fun.begin.com/appname
  • staging.static.fun.begin.com/appname

Once setup:

  • Commits to master deploy to staging.app-name-0x1.fun.begin.com (if the build is green)
  • Tags (Github releases) deploy to app-name-0x1.fun.begin.com (if the build is green)
  • You can also initiate a release from the web ui
  • Apps with npm run build defined will be run; .static is uploaded to their folder only; max 5mb
  • Apps can add 3 HTML route Lambdas; max 5 mb ea
  • Apps can add 5 JSON route Lambdas; max 5 mb ea
  • HTML and JSON endpoints support sessions