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

template-file

Package Overview
Dependencies
Maintainers
10
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

template-file - npm Package Compare versions

Comparing version 4.0.1 to 4.0.2

4

dist/cli.js

@@ -35,3 +35,3 @@ #!/usr/bin/env node

Object.defineProperty(exports, "__esModule", { value: true });
const promises_1 = __importDefault(require("fs/promises"));
const fs_1 = require("fs");
const glob_1 = __importDefault(require("glob"));

@@ -69,3 +69,3 @@ const meow_1 = __importDefault(require("meow"));

function renderToFile(file, destination) {
return limitOpenFiles(() => _1.renderTemplateFile(file, data).then(renderedString => promises_1.default.writeFile(destination, renderedString)));
return limitOpenFiles(() => _1.renderTemplateFile(file, data).then(renderedString => fs_1.promises.writeFile(destination, renderedString)));
}

@@ -72,0 +72,0 @@ glob(sourceGlob)

@@ -11,9 +11,6 @@ "use strict";

};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.renderTemplateFile = exports.renderString = void 0;
const deep_1 = require("@blakek/deep");
const promises_1 = __importDefault(require("fs/promises"));
const fs_1 = require("fs");
function renderString(template, data) {

@@ -36,3 +33,3 @@ return template.replace(/\{\{\s*(.*?)\s*\}\}/g, (_match, captured) => {

return __awaiter(this, void 0, void 0, function* () {
const templateString = yield promises_1.default.readFile(filepath, { encoding: 'utf-8' });
const templateString = yield fs_1.promises.readFile(filepath, { encoding: 'utf-8' });
return renderString(templateString, data);

@@ -39,0 +36,0 @@ });

{
"name": "template-file",
"version": "4.0.1",
"version": "4.0.2",
"main": "dist/index.js",

@@ -90,4 +90,4 @@ "description": "🔀 Replace {{ variables }} in all your files",

"typeCheck": "tsc --noEmit",
"validate": "run-p format-check lint typeCheck"
"validate": "run-p test format-check lint typeCheck"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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