New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@goldstack/utils-sh

Package Overview
Dependencies
Maintainers
1
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@goldstack/utils-sh - npm Package Compare versions

Comparing version 0.4.26 to 0.4.27

5

dist/src/utilsSh.d.ts

@@ -32,2 +32,4 @@ import { sync as globSync } from 'glob';

declare const read: (path: string) => string;
declare const tryRead: (path: string) => string | undefined;
declare const readToType: <T>(path: string) => T | undefined;
declare const write: (content: string, path: string) => void;

@@ -37,3 +39,4 @@ declare const pwd: () => string;

declare const commandExists: (command: string) => boolean;
export { exec, execSafe, pwd, read, write, cd, globSync, commandExists };
declare const changeExtension: (file: string, extension: string) => string;
export { exec, execSafe, pwd, read, write, cd, globSync, commandExists, readToType, tryRead, changeExtension, };
//# sourceMappingURL=utilsSh.d.ts.map

26

dist/src/utilsSh.js

@@ -6,3 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.commandExists = exports.globSync = exports.cd = exports.write = exports.read = exports.pwd = exports.execSafe = exports.exec = exports.execAsync = exports.tempDir = exports.unzip = exports.zip = exports.mkdir = exports.rm = exports.rmSafe = exports.cp = exports.assertDirectoryExists = exports.assertFileExists = exports.copy = void 0;
exports.changeExtension = exports.tryRead = exports.readToType = exports.commandExists = exports.globSync = exports.cd = exports.write = exports.read = exports.pwd = exports.execSafe = exports.exec = exports.execAsync = exports.tempDir = exports.unzip = exports.zip = exports.mkdir = exports.rm = exports.rmSafe = exports.cp = exports.assertDirectoryExists = exports.assertFileExists = exports.copy = void 0;
const child_process_1 = require("child_process");

@@ -250,2 +250,19 @@ const fs_1 = __importDefault(require("fs"));

exports.read = read;
const tryRead = (path) => {
let buffer;
try {
buffer = fs_1.default.readFileSync(path, 'utf8');
}
catch (ex) { }
return buffer === null || buffer === void 0 ? void 0 : buffer.toString();
};
exports.tryRead = tryRead;
const readToType = (path) => {
const stringObject = tryRead(path);
let result = undefined;
if (stringObject)
result = JSON.parse(stringObject);
return result;
};
exports.readToType = readToType;
const write = (content, path) => {

@@ -266,2 +283,9 @@ fs_1.default.writeFileSync(path, content);

exports.commandExists = commandExists;
// https://stackoverflow.com/a/57371333
const changeExtension = (file, extension) => {
// extension should include the dot, for example '.html'
const basename = path_1.default.basename(file, path_1.default.extname(file));
return path_1.default.join(path_1.default.dirname(file), basename + extension);
};
exports.changeExtension = changeExtension;
//# sourceMappingURL=utilsSh.js.map
{
"name": "@goldstack/utils-sh",
"version": "0.4.26",
"version": "0.4.27",
"description": "Utilities for working with files and folders in a bash like manner",

@@ -5,0 +5,0 @@ "keywords": [

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