template-file
Advanced tools
Comparing version 4.0.1 to 4.0.2
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
75230
115