Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

terraform-generator

Package Overview
Dependencies
Maintainers
1
Versions
106
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

terraform-generator - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

1

dist/index.d.ts

@@ -15,1 +15,2 @@ import { default as TerraformGenerator } from './TerraformGenerator';

export { default as Map } from './types/Map';
export { writePlan } from './utils';

@@ -30,1 +30,3 @@ "use strict";

exports.Map = Map_1.default;
var utils_1 = require("./utils");
exports.writePlan = utils_1.writePlan;

5

dist/utils/index.d.ts

@@ -1,1 +0,4 @@

export { writePlan } from './Utils';
export declare const writePlan: (plan: string, dir: string, options?: {
filename?: string;
format?: boolean;
}) => void;
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var Utils_1 = require("./Utils");
exports.writePlan = Utils_1.writePlan;
const shelljs_1 = __importDefault(require("shelljs"));
const fs_1 = __importDefault(require("fs"));
const path_1 = __importDefault(require("path"));
exports.writePlan = (plan, dir, options) => {
if (!options) {
options = {};
}
if (!options.filename) {
options.filename = 'terraform.tf';
}
if (!options.filename.endsWith('.tf')) {
options.filename += '.tf';
}
if (!fs_1.default.existsSync(dir)) {
shelljs_1.default.mkdir('-p', dir);
}
fs_1.default.writeFileSync(path_1.default.join(dir, options.filename), plan);
if (options.format) {
shelljs_1.default.exec(`cd ${dir} && terraform fmt`);
}
};
{
"name": "terraform-generator",
"version": "0.3.0",
"version": "0.3.1",
"author": "Ah Zhe",

@@ -9,5 +9,2 @@ "description": "Generate Terraform plan using Node.js.",

],
"files": [
"dist/**/*"
],
"homepage": "https://github.com/ahzhezhe/terraform-generator#readme",

@@ -19,2 +16,5 @@ "repository": {

"license": "ISC",
"files": [
"dist/**/*"
],
"main": "dist/index.js",

@@ -26,4 +26,4 @@ "types": "dist/index.d.ts",

"tryout": "ts-node tryout.ts",
"build": "tsc",
"prepublishOnly": "del-cli --force dist && tsc",
"build": "del-cli --force dist && tsc",
"prepublishOnly": "npm run build",
"postpublish": "del-cli --force dist"

@@ -30,0 +30,0 @@ },

@@ -42,2 +42,7 @@ # **terraform-generator**

### **Import**
```javascript
import TerraformGenerator, { Resource, Map, Argument, writePlan } from 'terraform-generator';
```
### **Initiate TerraformGenerator**

@@ -115,4 +120,2 @@ ```javascript

```javascript
import { writePlan } from 'terraform-generator/utils';
// Write Terraform plan to a file

@@ -126,4 +129,3 @@ // Default filename is terraform.tf

```javascript
import TerraformGenerator, { Provider, Resource, DataSource, Output, Map } from 'terraform-generator';
import { writePlan } from 'terraform-generator/utils';
import TerraformGenerator, { Map, writePlan } from 'terraform-generator';
import fs from 'fs';

@@ -130,0 +132,0 @@ import path from 'path';

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc