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

simplify-cli

v0.1.39

Published

Simplify CLI - Easy Deployment

Downloads

12

Readme

Simplify Framework - Easy Deployment

NPM Downloads Package Version

A minimalist and optimistic serverless framwork for managing AWS Lambda functions.

npm install -g simplify-cli

$ simplify-cli init

 - Choose a Project name? (starwars) 
 - Choose an S3 Bucket name? (starwars-0920) 
 - Choose an Environment? (demo) 

$ simplify-cli register
$ simplify-cli login
$ simplify-cli create --help

╓───────────────────────────────────────────────────────────────╖
║                 Simplify CLI - Version 0.1.24                 ║
╙───────────────────────────────────────────────────────────────╜

Create a deployment template: simplify-cli create [--template=]Detector | ShowLog
 1. Detector - A Python Detector function based on Python 3.7 runtime.
 2. ShowLog - A CloudWatch Log reader function based on NodeJS 12.x.

Create associated CF stack: simplify-cli create [--template=]CloudFront | CognitoUser...

 1. CloudFront - A template to create a CDN using CloudFront for S3 Website and HTTP APIs origin.
 2. CognitoUser - A template to create a Cognito UserPool, Cognito Indentity and Pinpoint analytics.
 3. EventScheduler - A CloudWatch scheduler event for triggering a lambda function with schedule expresion.
 4. HttpRestapi - A template to create a REST API Gateway that work with Lambda functions.
 5. LambdaEdge - A template to create a CDN using CloudFront that works with LambdaEdge function.
 6. Randomness - A Lambda randomness source to use in common case for other Lambdas.
 7. WebsiteS3 - An HTML website hosting by Amazon S3 Bucket that support publishing extension script.

 * Or fetch from YAML: simplify-cli create [--template=]https://github.com/awslabs/...template.yml

Deploy your function

1. simplify-cli deploy --function LambdaTest --source src             # resilience deploying your function code 
2. simplify-cli deploy --function LambdaTest --update --publish       # publish the latest code to a lambda version
3. simplify-cli deploy --function LambdaTest --layer --source layer   # make the layer/nodejs folder into lambda layer

Destroy your function

1. simplify-cli destroy --function LambdaTest                         # destroy your function only, keep layers
2. simplify-cli destroy --function LambdaTest --layer                 # destroy your function with all layers

Deploy a CloudFormation stack

1. simplify-cli deploy --stack HttpRestapi     # create a stack from "${location}/${stack-name}.yaml"
3. simplify-cli deploy --stack HttpRestapi --location templates

Destroy a CloudFormation stack

1. simplify-cli destroy --stack HttpRestapi    # delete a selected stack name

Deployment Extension for CloudFromation

  • Each stack has an ability to add an extension code for stack creation/destruction.
  • The extension Javascript file will be located at ${location}/${stack-name}.js
'use strict';
const path = require('path')
const fs = require('fs')
const opName = `Extension`
module.exports = {
    /** Called before stack creation, return StackParameters = { Environmemt, ...} */
    preCreation: function(adaptor, stackName, mappedParameters, stackYAML, stackInputs) {
        return Promise.resolve(stackParameters)
    },
    /** Called after the `${location}/${stack-name}.yaml` was deployed */
    postCreation: function(adaptor, stackName, stackData) {
        const { simplify, provider, config } = adaptor
        return Promise.resolve(stackData)
    },
    /** Called before stack destruction, return { stackName } */
    preCleanup: function(adaptor, stackName, stackList) {
        const { simplify, provider, config } = adaptor
        return Promise.resolve(stackName)
    },
    /** Called after the `${location}/${stack-name}.yaml` was destroyed  */
    postCleanup: function(adaptor, stackName, stackList, stackData) {
        const { simplify, provider, config } = adaptor
        return Promise.resolve(stackData)
    }
}