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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@terraforge/core

v0.0.42

Published

Infrastructure as code made fast & easy

Downloads

950

Readme

Infrastructure as code made fast & easy

The core of Terraforge lives in @terraforge/core, with the Terraform bridge in @terraforge/terraform. Together they provide a fast, diff-friendly IaC workflow for AWS (and custom) stacks.

The problem

The most used IaC solutions are slow & don't effectively leverage diffing to speed up their deployments.

Setup

Install with (NPM):

npm i @terraforge/core @terraforge/terraform @terraforge/aws

Example

First, you need to create a workspace instance and pass in the cloud providers that you will use. We also need to give it a lock backend & state backend.

  • A cloud provider is used to create resources on a specific cloud provider. We have built-in cloud providers for AWS resources, but you could simply add your own as well.

  • The state backend is used for storing the latest deployment state.

  • The lock backend is used for acquiring a lock when you deploy your app. This will guarantee that multiple people can never deploy the same application at the same time.

  • The activity log backend is used for storing the activity log when every you deploy / delete your app.

In this example, we will use a local file lock & state provider.

import { App, FileStateBackend, FileLockBackend, Stack, WorkSpace } from '@terraforge/core'
import { aws } from '@terraforge/aws'

const workspace = new WorkSpace({
	providers: [
		aws({
			profile: "PROFILE",
			region: "REGION"
		})
	],
	backend: {
		state: new FileStateBackend({ dir: './states' }),
		lock: new FileLockBackend({ dir: './locks' }),
	}
})

With your workspace configuration ready we can now move on to defining your infrastructure. This example illustrates how simple it is to define multi-stack resources without worrying about cross-stack references.

const app = new App('todo-app')
const storage = new Stack(app, 'storage')
const list = new aws.s3.Bucket(storage, 'todo-list', {
	bucket: 'your-bucket-name'
})

const items = new Stack(app, 'items')
const todo = new aws.s3.BucketObject(items, 'todo-item', {
	bucket: list.bucket,
	key: 'item-1',
	content: JSON.stringify({
		title: 'Write docs...',
		done: true,
	}),
})

After defining your infrastructure, we can deploy our app.

await workspace.deploy(app)

Or destroy our app.

await workspace.delete(app)

Maybe you want to only deploy a subset of stacks.

await workspace.deploy(app, {
	filters: ["storage"]
})

Production

For production, we recommend you use a state & lock backend that stores your data in the cloud. An AWS DynamoDB table is perfect for storing locks. While AWS S3 is perfect for storing your state files.

const workspace = new WorkSpace({
	providers: [...],
	backend: {
		lock: new DynamoLockBackend({
  			region,
  			credentials,
  			tableName: 'awsless-locks',
  		}),
		state: new S3StateBackend({
			region,
			credentials,
			bucket: 'awsless-state-UNIQUE_ID',
		}),
	}
})