@tobimadehin/playground
v1.0.20
Published
Multi-cloud ephemeral VM library
Downloads
119
Maintainers
Readme
Playground
Playground lets you launch, manage, and clean up cloud instances across multiple providers. The playground itself is stateless, so you choose how to track instances.
Quick Start
- Install the package
npm install @tobimadehin/playground- Create a provider map
import { AWSProvider, Playground } from '@tobimadehin/playground';
const providers = new Map();
providers.set('aws', new AWSProvider({
accessKeyId: '...',
secretAccessKey: '...',
region: 'us-east-1'
}));
const playground = new Playground({
providers,
imageMappingsPath: './examples/image-mappings.yaml'
});- Launch an instance
const instance = await playground.createInstance({
imageType: 'ubuntu-22-small',
sshKey: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAB... user@host'
});
console.log('Instance created:', instance.id, instance.ip);- Track and clean up
import { PlaygroundUtils } from '@tobimadehin/playground';
if (PlaygroundUtils.isExpired(instance)) {
await playground.destroyInstance(instance.provider, instance.id);
}Next Steps
- View example configurations
- View provider implementations
- Learn about state management patterns
- Explore multi-cloud failover and region-specific deployments
- Check-out dployr (Your app, your server, your rules!) - https://dployr.dev
License
MIT License — see LICENSE for details.
