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

pulumi-local

v2.9.0

Published

A Pulumi provider for managing local files, directories, and sensitive files, dynamically bridged from the Terraform Local provider with support for creating, reading, and managing local filesystem resources.

Readme

Pulumi Local Provider

A Pulumi provider for managing local files, directories, and sensitive files, dynamically bridged from the Terraform Local Provider.

Introduction

This package provides a Pulumi provider that enables you to manage local filesystem resources using TypeScript, JavaScript, Python, Go, or C#. The provider is automatically generated from the Terraform Local provider, giving you access to all its functionality within the Pulumi ecosystem.

Features

  • File Management: Create and manage local files with specific content and permissions
  • Sensitive Files: Handle files containing sensitive data with appropriate protections
  • File Reading: Read existing local files as data sources
  • Command Execution: Execute local commands and capture output
  • TypeScript Support: Full type safety with comprehensive TypeScript definitions

Installation

npm

npm install pulumi-local

yarn

yarn add pulumi-local

pnpm

pnpm add pulumi-local

bun

bun add pulumi-local

Configuration

The Local provider typically doesn't require explicit configuration as it operates on the local filesystem.

Quick Start

File Example

import * as pulumi from '@pulumi/pulumi'
import * as local from 'pulumi-local'

// Create a local file
const config = new local.File('app-config', {
  filename: '/tmp/config.json',
  content: JSON.stringify({
    environment: 'production',
    debug: false,
  }),
})

// Export the file path
export const configPath = config.filename

Sensitive File Example

import * as pulumi from '@pulumi/pulumi'
import * as local from 'pulumi-local'

// Create a file with sensitive content (restricted permissions)
const secretFile = new local.SensitiveFile('credentials', {
  filename: '/tmp/credentials.json',
  content: JSON.stringify({
    apiKey: 'secret-key-value',
    dbPassword: 'secret-password',
  }),
})

Read File Example

import * as pulumi from '@pulumi/pulumi'
import * as local from 'pulumi-local'

// Read an existing file
const existingConfig = local.getFile({
  filename: '/etc/hostname',
})

export const hostname = existingConfig.then((f) => f.content)

Available Resources

This provider supports the following resources:

  • File: Create and manage local files with content and permissions
  • SensitiveFile: Create files containing sensitive data with restricted permissions

Data Sources

  • getFile: Read the content of an existing local file
  • getSensitiveFile: Read the content of an existing sensitive file
  • getCommand: Execute a local command and capture its output

Advanced Usage

Generate Configuration Files

import * as pulumi from '@pulumi/pulumi'
import * as local from 'pulumi-local'

const stack = pulumi.getStack()

// Generate environment-specific config
const envConfig = new local.File('env-config', {
  filename: `.env.${stack}`,
  content: pulumi.interpolate`
NODE_ENV=${stack}
API_URL=https://api.${stack}.example.com
LOG_LEVEL=${stack === 'production' ? 'warn' : 'debug'}
`.apply((s) => s.trim()),
})

Template Rendering

import * as local from 'pulumi-local'

// Create an nginx config from a template
const nginxConfig = new local.File('nginx-config', {
  filename: '/etc/nginx/conf.d/app.conf',
  content: `
server {
    listen 80;
    server_name example.com;

    location / {
        proxy_pass http://localhost:3000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}
`,
})

Execute Commands

import * as local from 'pulumi-local'

// Execute a command and capture output
const gitCommit = local.getCommand({
  command: 'git rev-parse HEAD',
})

Documentation

For detailed documentation on all available resources and their properties, visit:

Troubleshooting

Permission Errors

If you encounter permission errors:

  1. Verify the target directory exists and is writable
  2. Check file permissions for the Pulumi process user
  3. For sensitive files, ensure the process has appropriate privileges

Common Issues

Issue: ENOENT: no such file or directory Solution: Ensure the parent directory exists before creating files

Issue: EACCES: permission denied Solution: Check directory and file permissions, run with appropriate privileges

Issue: File content not updating Solution: Verify the content input has changed; Pulumi skips updates when inputs are identical

Examples

For more examples, check out the examples directory in the repository.

Contributing

Contributions are welcome! Please read the Contributing Guide for details on our code of conduct and the process for submitting pull requests.

Support

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Related Projects


Part of the Pulumi Any Terraform collection