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

fluct

v0.4.2

Published

Fluct is a framework to build server-less web applications using [Lambda](https://aws.amazon.com/lambda/) and [API Gateway](https://aws.amazon.com/api-gateway/). This stack brings about great advantages in the web development, such as fully isolated compo

Downloads

45

Readme

Fluct

Fluct is a framework to build server-less web applications using Lambda and API Gateway. This stack brings about great advantages in the web development, such as fully isolated components, infinitely scalability, easy and rapid development, cheap server cost, and more and more.

Getting Started

1. Install

Install fluct executable via npm.

$ npm install fluct -g

2. Create an application

Create a new application with an application name.

$ fluct new myapp
Created ./myapp
Created ./myapp/.gitignore
Created ./myapp/actions
Created ./myapp/actions/.keep
Created ./myapp/package.json

3. Create an action

Enter the application folder and generate a new action.

$ cd myapp
$ fluct generate list_users
Created ./actions/list_users
Created ./actions/list_users/index.js
Created ./actions/list_users/package.json

4. Set up the action

Update the action's package.json with proper httpMethod and path.

$ vi actions/list_users/package.json
$ cat actions/list_users/package.json
{
  "name": "list_users",
  "private": true,
  "fluct": {
    "contentType": "text/html",
    "httpMethod": "GET",
    "path": "/users",
    "statusCode": 200
  }
}

5. Set up the package.json

Head over to AWS Console and create a new IAM role that has AWSLambdaBasicExecutionRole, then set its role name and your account ID to application's package.json (Account ID is written in integers in user's ARN). This role is used to allow API Gateway to invoke Lambda functions.

$ vi package.json
$ cat package.json
{
  "name": "myapp",
  "private": true,
  "fluct": {
    "accountId": "012345678912",
    "restapiId": null,
    "roleName": "fluct-example-role"
  }
}

6. Deploy it

Deploy your application to Lambda and API Gateway.

$ fluct deploy
Created zip file: ./actions/list_users/lambda.zip
Uploaded function: list_users
Updated endpoint: GET /users
Deployed: https://123ge4oabj.execute-api.us-east-1.amazonaws.com/production

7. Done!

Try to send HTTP requests to your endpoints.

$ curl https://123ge4oabj.execute-api.us-east-1.amazonaws.com/production/users -i
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 13
Connection: keep-alive
Date: Tue, 11 Aug 2015 19:22:33 GMT
x-amzn-RequestId: 512f8391-405e-11e5-acef-2125b850bbe1
X-Cache: Miss from cloudfront
Via: 1.1 6145a790e7dca1c0c567e1f5decce786.cloudfront.net (CloudFront)
X-Amz-Cf-Id: 5LvHm6SaEQnTj1ubwlCvJhew6G86AU6FFEGB2ic3FI-r7kwNfwDCXg==

Hello, world!

Now that you’re up and running, here are a few things you should know. See CLI to use utility commands to develop your application, and see FAQ to know how to customize your application.