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

@ashnazg/precipitator

v0.0.3

Published

a higher level wrapper for cloud provisioning APIs

Downloads

5

Readme


title: "@ashnazg/precipitator" sidebar_label: "precipitator"

Usage

var ec2   = require('@ashnazg/precipitator/create-ec2.js'); // ~/projects/ashnazg-npm/precipitator/create-ec2.js
var setup = require('@ashnazg/precipitator/ssh-setup.js');  // ~/projects/ashnazg-npm/precipitator/ssh-setup.js

async function exampleLibUsage() {
	ec2.init('us-west-2'); // if you don't init() with your desired region, it'll default to us-west-2

	var disk_in_gigs = 8;
	var tags = {Name: 'server label Name'};
	var conf = ec2.createConfig(tags, {
		InstanceType: 't3a.nano',
		ImageId:  'ami-06e54d05255faf8f6',
		KeyName: '[email protected]',

	// SubnetId: 'subnet-6804e831', // if unspecified, AWS will pick from valid subnets
	// SecurityGroupIds: ['sg-35137850'], // if unspecified, AWS will use your sg named 'default'

	// these are the default and can be omitted:
	//	MinCount: 1,
	//	MaxCount: 1
	}, disk_in_gigs);

	try {
		var definition = await ec2.createEC2(conf); // note that Name is just a tag; I'm going to actually set up DNS/certs in a later call.
		var {url, ip} = definition;
		// url is a convenience link to the aws ec2 console with this server selected in the filters.
		// there's also regurgitations of {conf, opts} so that you can associate the results with the inputs you gave
		// {create_resp, describe_resp} are the full AWS responses for those api calls; {meta} is a shortcut to just the instance description itself.
	} catch (e) {
		u.die(e);
	}
	try {
		var sudo_user = 'ubuntu';
		var {package_manager} = await setup.waitForReadiness(definition, sudo_user, {tries: 10, retry_delay: 5, initial_delay: 0, verbosity: 0});
		// waitForReadiness returns the same definition except that it's added 'yum' or 'apt-get' as {package_manager}
	} catch (e) {
		console.error("could not reach new ec2:");
		u.die(e);
	}
}