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

cloudlify

v0.0.7

Published

The simple cloud infrastructure launcher using Handlebars for template processing.

Downloads

3

Readme

Cloudlify

The simple cloud infrastructure launcher using Handlebars for template processing.

NOTE: Stack template examples will be posted shortly!

Use the Cloudlify npm module to compile yaml templates and execute cloud service provider commands.

Cloudlify uses Handlebars for merging the JSON formatted configuration file into the final template.

Currently we have AWS as a provider.

Install

npm install --save cloudlify

Requirements

Depending on the provider, which currently is only AWS, you will need the AWS CLI tools installed.

  • AWS CLI tools - https://aws.amazon.com/cli/
  • Amazon account with proper IAM roles/policies to access all the services you are deploying
  • AWS Access Key: IAM > User > Security Credentials > Access Keys ( Create Access Key )
  • AWS CLI Credentials locally - Create a folder under your profile for aws credentials ~/.aws ( MacOS )

Multiple AWS Profile Examples

~/.aws/config

[default]
output = text
region = us-east-1
[profile other]
region = us-west-2

~/.aws/credentials

[default]
aws_access_key_id = 
aws_secret_access_key = 
[other]
aws_access_key_id = 
aws_secret_access_key = 

Usage Example

./app.js

const Cloudlify = require( 'cloudlify' ),
	yaml = require( 'yamljs' );
	
var configuration = yaml.load( './config/common.yaml' );

var cloudlify = new Cloudlify( configuration, '{ optional non default aws profile name for aws cli }' );

cloudlify.create();

Configuration Example

./config/common.yaml

# AWS Cloud Configuration
# Required: ./templates/master.yaml ( Handlebars template )

Stack:
  Name: my-stack-prod

Build:
  Template: master
  Environment: development

Provider:
  Name: AWS
  Region: us-east-1
  Bucket: my-deploy-bucket

SecurityGroups:
  PublicCidr: 0.0.0.0/0

VPC:
  Id: vpc-someidhere
  SubnetId: subnet-someidhere
  OpenPorts:
    - 80
    - 443
    - 22
    - 3306

Host:
  ID: MyHostID
  KeyName: myawskey
  InstanceType: t3.micro
  ElasticIPAllocationId: eipalloc-someidhereifyouhaveone

Service:
  Name: MyServiceName
  Containers:
    - Name: Web
      Image: wordpress:latest
      Host: www.domain.com
    - Name: DB
      Image: mariadb:latest
    - Name: Proxy
      Image: jwilder/nginx-proxy
    - Name: LetsEncrypt
      Image: jrcs/letsencrypt-nginx-proxy-companion

Logs:
  RetentionInDays: 1

Environment Vars

Environment variables placed in a .env file can be used with the yaml configuration. If you pass a configuration yaml path to Cloudlify it will pre-process it with Handlebars and make ENV.MY_VAR substitutions before loading the it as a JSON object.

.env

MY_VAR = 1234

./config.yaml

Service:
  Name: Testing
  ID: {{ENV.MY_VAR}}

Folders

Cloudlify uses the following folders relative to where the package is called.

  • Configurations: ./config
  • Master templates: ./templates
  • Partial templates: ./partials
  • Build output: ./build
  • Compiled output: ./dist

Roadmap

  • Full example project with templates
  • Test library
  • Linting
  • Convert to TypeScript
  • Add more Providers
  • Kubernetes ready
  • Refactoring

Contributions

All contributions welcome! Branch off master and submit a pull request for review.

History

  • 0.0.7 - Allow option to pass a yaml config path to Cloudlify. It will be pre-processed for ENV vars by Handlebars.
  • 0.0.6 - Move force update of services to update() function
  • 0.0.5 - Update example to use yaml for configuration. It's just better ;)
  • 0.0.4 - Check if multiple host services are configured when running an updateService command.
  • 0.0.3 - Refactor AWS commands and configuration structure.
  • 0.0.1 - Initialize!