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-sdk

v0.1.59

Published

Simplify Framework SDK library for NodeJS

Downloads

248

Readme

Simplify Framework - JavaScript SDK

NPM Downloads Package Version

This is a JavaScript SDK that help DevOps easier by integrating deployment process inline to your code. You will never want to be locked into any vendor for a tool. In FaaS architecture, a function can be very small but a project needs some (3-100) functions to orchestrate a workload. One CI/CD tool for all of them is quite vague to deploy your project when you just need to update one line of a function.

By using this SDK, you can breakdown your CI/CD tool as a function. Once again, FaaS concept now being applied for DevOps process. When you are micro focused into a function, a micro CI/CD function is beside of you. You're always feel safe and be efficiency. Simplify CodeGen generates a first code for you. It works well enough until you need to customize for your best fit. Happy OpenSource ₩

To start, choose one of two serverless models: OpenAPI or GraphQL

Simplify - JavaScript SDK

npm install simplify-sdk

Deploy for AWS Lambda Configuration: config.json

{
    "Profile": "${DEPLOYMENT_PROFILE}",
    "Region": "${DEPLOYMENT_REGION}",
    "Bucket": {
        "Name": "${DEPLOYMENT_BUCKET}",
        "Key": "builds/${DATE_TODAY}"
    },
    "Function": {
        "FunctionName": "${FUNCTION_NAME}",
        "Handler": "index.handler",
        "MemorySize": 256,
        "Publish": true,
        "Role": "${FUNCTION_ROLE}",
        "Runtime": "nodejs12.x",
        "Tags": {
            "Group": "Simplify"
        },
        "Timeout": 15,
        "TracingConfig": {
            "Mode": "PassThrough"
        },
        "Environment": {
            "Variables": {
                "ENV": "development"
            }
        }
    }
}

Deoloy AWS Lambda Function example: main.js

'use strict';
const path = require('path')
const fs = require('fs')
const simplify = require('simplify-sdk')
const provider = require('simplify-sdk/provider')

const YOUR_DEPLOYMENT_REGION = "eu-west-1"
const YOUR_DEPLOYMENT_BUCKET = "your-deployment-bucket-2873821"
const YOUR_FUNCTION_NAME = "YourLambdaFunction-1WDRZ5J5OUN5H"
const YOUR_FUNCTION_ROLE = "arn:aws:iam::01234567890:role/YourLambdaExecutionRole"
var YOUR_FUNCTION_SHA256 = "LOAD_FROM_OUTPUT_FILE__data.YOUR_FUNCTION_SHA256"

var config = simplify.getInputConfig(path.join(__dirname, 'config.json'), {
    DEPLOYMENT_BUCKET: YOUR_DEPLOYMENT_BUCKET,
    DEPLOYMENT_REGION: YOUR_DEPLOYMENT_REGION,
    FUNCTION_NAME: YOUR_FUNCTION_NAME,
    FUNCTION_ROLE: YOUR_FUNCTION_ROLE
})

provider.setConfig(config).then(sessionCreds => {
    simplify.uploadDirectoryAsZip({
        adaptor: provider.getStorage(), ...{
            bucketKey: config.Bucket.Key,
            inputDirectory: 'src',
            outputFilePath: 'dist',
            hashInfo: { FileSha256: YOUR_FUNCTION_SHA256 }
        }
    }).then(uploadInfor => {
        simplify.createOrUpdateFunction({
            adaptor: provider.getFunction(),
            ...{
                functionConfig: config.Function,
                bucketName: config.Bucket.Name,
                bucketKey: uploadInfor.Key
            }
        }).then(function (data) {
            // Handle data response: save output to file...
            data.YOUR_FUNCTION_SHA256 = uploadInfor.FileSha256
            console.log(`Update-Function: ${data}`)
        }, function(err) {
            console.error(`Update-ERROR: ${err}`);
        })
    }).catch(err => {
        console.error(`UploadZip-ERROR: ${err}`);
    })
})