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

@serverless/sf

v0.0.6

Published

N/A

Downloads

2

Readme

Serverless Framework V.2

 

"The future of cloud is outcomes, not infrastructure."

 

 

Get Started

Clone repo.

$ git clone https://github.com/serverless/v2.git

Install dependencies.

cd v2 && npm i -g

Pick an example. Each example requires credentials for Amazon Web Services set as environment variables.

Serverless Framework V.2 supports .env files in the same folder as serverless.yml or serverless.js. Create one that looks like this:

AWS_ACCESS_KEY_ID=123456789
AWS_SECRET_ACCESS_KEY=987654321

Run $ v2.

$ website: v2
  
  ✔  my-site

     URL  http://serverless-6vql3jp9.s3-website-us-east-1.amazonaws.com

  3s › dev › my-site › Done

You can leverage different environment variables for different stages by using this naming convention:

.env # Default
.env.dev
.env.prod

How To Use A Serverless Component Programmatically

Create a new javascript file, and load/use Components like this:


// To load a Component, instantiate it's class...
const realtimeApp = new RealtimeApp('instanceId', { /* inputs */ })

// To run/deploy/update a Component, call it's default function...
await realtimeApp()

// To run extra functionality, use custom methods that come w/ the Component...
await realtimeApp.loadTest()

How To Use A Serverless Component Declaratively

Use a serverless.yml file, like this:


name: realtimeApp
stage: dev

providers:
  AwsProvider::aws:
    accessKeyId: ${secrets:aws_access_key_id}
    secretAccessKey: ${secrets:secret_access_key}

components:
  RealtimeApp::realtimeApp:
    name: ${name}-${stage}
    code: ./src/backend

Then use your CLI, like this:

# To run/deploy/update all Components, call 'serverless'...
$ serverless

# To run extra functionality that comes with the a component, call this...
$ serverless loadTest myRealtimeApp

# To remove Components in YAML, call this...
$ serverless remove

How To Write A Serverless Component

Use a serverless.js file, like this:


class MyComponent extends Component {

  /*
  * Default (Required)
  * - The default functionality to run/provision/update your Component
  */

  async default() { }

  /*
  * Remove (Optional)
  * - If your Component removes infrastructure, this is recommended.
  */

  async remove() { }
}

Created By

  • Eslam Hefnawy - @eahefnawy
  • Philipp Muens - @pmmuens